Sub topic 13
Account Types, Taxes and Employer Match
The earlier chapters produced a monthly saving target from a pre-tax view of the world. The nest egg was a single number, and the monthly payment was a single number. Real accounts add two complications. Withdrawals may be taxed, and your employer may add money to the account. This chapter shows where each one enters the formula.
This chapter assumes you have read the chapters on the required nest egg and on solving for the monthly target. You should know nest_egg and monthly_saving. The terms here (401(k), IRA, Roth) are from the United States. Most countries have similar accounts under other names, and the logic carries over.
Three kinds of account
Accounts differ mainly in when tax is paid.
| Account type | Contribution | Growth | Withdrawal | Typical examples |
|---|---|---|---|---|
| Tax-deferred (traditional) | Made before income tax, so it lowers taxable pay now | Not taxed while inside | Taxed as ordinary income | Traditional 401(k), traditional IRA |
| Tax-free (Roth) | Made from after-tax pay | Not taxed while inside | Not taxed if rules are met | Roth 401(k), Roth IRA |
| Taxable | Made from after-tax pay | Dividends and gains may be taxed each year or on sale | Only gains are taxed | Ordinary brokerage account |
The rules behind each row (contribution limits, age limits, penalties for early withdrawal) change often and differ by country. Check the current rules for your account before you rely on any figure.
Why the spending number must be after-tax
Your retirement spending estimate is money you want to spend. If the nest egg sits in a tax-deferred account, part of each withdrawal goes to tax before you can spend it. The withdrawal must be larger than the spending.
Suppose you want $36,000 a year to spend and expect an average tax rate of 15% on withdrawals. The gross withdrawal W must satisfy W × (1 − 0.15) = 36,000, so:
W = spend_after_tax / (1 − tax_rate)
That gives about $42,353 a year. The nest_egg function then runs on this larger number. Divide by (1 − tax_rate) and not multiply by (1 + tax_rate). Multiplying by 1.15 would give $41,400, which is too low, because tax is taken from the gross amount and not added to the net amount.
Use an average tax rate here and not your top (marginal) rate. Retirement income is usually lower than working income, and the first part of it is taxed lightly. Using today's marginal rate overstates the problem. Using zero understates it.
For a Roth account the gross-up is not needed, because withdrawals arrive untaxed. The cost has moved to the contribution side. Each Roth dollar comes out of pay that has already been taxed. A traditional dollar reduces your tax bill now, so it costs less take-home pay. At a 24% marginal rate, a $1,000 traditional contribution reduces take-home pay by about $760.
Two pitfalls follow. Comparing a traditional and a Roth monthly target dollar for dollar is misleading, because they are measured at different points in the tax cycle. A fair comparison puts both in take-home terms. Also, if your plan already estimates spending net of tax, applying the gross-up again double counts the tax.
How an employer match changes the target
An employer match is money the employer adds when you contribute. A common formula is "50% of your contributions, up to 6% of salary." Three terms matter:
- The match rate is the fraction the employer adds per dollar you contribute (here 0.5).
- The match cap is the most of your contribution that earns a match (here 6% of salary).
- The total monthly contribution is yours plus the employer's.
The formula for monthly_saving solves for the total that must enter the account each month. It does not care who pays. So the work is to split that total into your share and the employer's share.
Let T be the total needed, m the match rate, and cap the monthly amount of your contribution that earns a match. There are two cases:
- If you stay at or below the cap, every dollar you pay earns a match. The total is
c × (1 + m), soc = T / (1 + m). - If you need more than the cap allows, the match is maxed out at
cap × m. You pay the rest:c = T − cap × m.
The switch point is T = cap × (1 + m).
The code
This script is self-contained. It includes nest_egg and monthly_saving from earlier, and adds two small functions.
def nest_egg(annual_spend_today, years, inflation, other_income_today=0.0, withdrawal_rate=0.04):
"""Nest egg needed at retirement, in future dollars."""
need_today = max(annual_spend_today - other_income_today, 0.0)
need_future = need_today * (1 + inflation) ** years
return need_future / withdrawal_rate
def monthly_saving(target, years, annual_return, current_balance=0.0):
"""Level monthly contribution, paid at the end of each month, that reaches target."""
n = years * 12
r = annual_return / 12
balance_future = current_balance * (1 + r) ** n
gap = max(target - balance_future, 0.0)
if r == 0:
return gap / n
return gap * r / ((1 + r) ** n - 1)
def gross_up(after_tax_spend, tax_rate):
"""Pre-tax withdrawal that leaves after_tax_spend once tax is paid."""
if not 0 <= tax_rate < 1:
raise ValueError("tax_rate must be at least 0 and below 1")
return after_tax_spend / (1 - tax_rate)
def employee_share(total_needed, match_rate, match_cap_monthly):
"""Part of the total monthly contribution that you pay, given an employer match."""
full_match_total = match_cap_monthly * (1 + match_rate)
if total_needed <= full_match_total:
return total_needed / (1 + match_rate)
return total_needed - match_cap_monthly * match_rate
years, inflation, annual_return = 30, 0.025, 0.06
salary = 90_000
cap = 0.06 * salary / 12 # 450 per month earns a match
match_rate = 0.5
plain = monthly_saving(nest_egg(36_000, years, inflation), years, annual_return)
taxed = monthly_saving(nest_egg(gross_up(36_000, 0.15), years, inflation), years, annual_return)
yours = employee_share(taxed, match_rate, cap)
print(f"Ignoring tax: {plain:8.2f} per month")
print(f"After tax gross-up: {taxed:8.2f} per month")
print(f"Your share with match: {yours:8.2f} per month")With these inputs the three lines come to about $1,879, $2,211 and $1,986. Run it to confirm. The tax gross-up adds about $330 a month. The match removes $225, which is cap × match_rate, because the total far exceeds the cap.
Edge cases and common errors
- The match is a fixed dollar amount in this example, but in practice it is a percentage of salary. As your salary rises, the cap rises too. A target that must grow with your raises is closer to the rising-contribution model from the previous chapter than to a flat one.
- A match may vest, meaning it becomes yours only after a number of years of service. If you might leave before vesting, count only the vested part as certain.
- Contribution limits cap how much can enter each account per year. If the total needed exceeds the limit, the surplus must go to another account, often a taxable one. Check whether employer contributions count toward the same limit.
- The 15% average tax rate is an assumption. Taxes on withdrawals depend on the mix of accounts, other income, and rules that may change over thirty years. Treat it as an input to the sensitivity tests in the next chapter.
- Do not mix real and nominal figures. The match cap is stated in today's dollars of salary, while the monthly target is a nominal amount that will be paid at the future salary level.
- Holding several account types spreads tax risk. A traditional balance gives taxable income in retirement, while a Roth balance can be withdrawn without adding to taxable income. The formulas above treat one pot. For a mix, compute a blended average tax rate in proportion to the planned withdrawals from each.
Summary of the changes to the workflow
- Express desired spending after tax.
- Gross it up by
1 / (1 − average tax rate)if withdrawals come from tax-deferred accounts. - Compute the nest egg and the total monthly contribution as before.
- Split the total into your share and the employer's share using the match rule.
Exercise
You need a total of $1,500 a month going into your 401(k). Your employer matches 100% of your contributions up to $400 a month of your pay. How much should you contribute each month, and how much does the employer add?
Show answer
The total ($1,500) is above cap × (1 + match rate) = 400 × 2 = 800, so the match is maxed out at 400 × 1.0 = $400. You contribute 1,500 − 400 = $1,100, and the employer adds $400.
Exercise
You want $45,000 a year to spend in retirement, after tax, from a tax-deferred account. You expect to pay an average 20% tax on withdrawals. What pre-tax annual withdrawal do you need, in today's dollars? Why is it not $54,000?
Show answer
45,000 / (1 − 0.20) = $56,250. Multiplying by 1.20 would give $54,000, but tax is 20% of the gross withdrawal, not 20% of the net amount. Taking 20% of $54,000 leaves only $43,200, which is short of $45,000.