How the US Tax Code Really Works
Tax brackets are only one input to what you actually pay. Here is why earning more can lower your tax rate, how $1 of income can trigger a $26,600 bill, and what actually drives your real tax rate.
The tax bracket illusion
The US tax code is one of the most complex tax systems in the world, yet most people think about it through one simple idea: tax brackets. As your income goes up, you enter higher brackets and pay a higher rate on the extra income. Some types of income get lower rates, like long-term capital gains (investments held for more than a year), which are taxed at 0%, 15%, or 20% federally instead of up to 37%.
People naturally use those brackets to estimate how much of a paycheck, bonus, or stock sale will go to taxes. Say you and your spouse plan to sell appreciated stock you have held for more than a year. You check the federal capital gains brackets and see 15%. If you also know about the Net Investment Income Tax (NIIT), a 3.8% surtax on investment income once your total income passes $250,000, you expect to pay 18.8% in federal tax.
Unfortunately, that is not always what happens. You might end up paying almost 10 percentage points more (28.4% federal, or close to 39% in a state like California). And if you sell even more stock past a certain point, your tax rate on each additional dollar can suddenly drop back down by 10 points. That might not change your decision to sell, or it might be a big factor in how much you decide to sell this year.
This is not just a high-income issue either. An early-retired couple in the 0% federal capital gains bracket can earn $1 past an income threshold and owe $26,600 overnight. A middle-class retiree in the 12% federal bracket can easily lose 24% to 28% of every dollar they withdraw from an IRA.
Most people carry three intuitive assumptions about how a progressive tax system works:
- 1.As your income goes up, you pay more in total taxes.
- 2.As your income goes up, the tax rate on additional income always rises or stays flat.
- 3.Earning $1 more always leaves you with more money after taxes.
Only the first one mostly holds (outside a few low-income refundable credits like the EITC). The other two break all the time, across the entire income spectrum from near the Federal Poverty Level up to $10M+ a year. The reason is that tax brackets are only one input to your actual tax rate. Your real rate also depends on how different types of income stack together, plus phaseouts and cliffs built into deductions and credits.
How a 15% tax becomes 38.7%
Before getting into why your rate can jump by 10 points, let's walk through how the pieces fit together. So far, everything about brackets is pretty simple. For a married couple filing jointly in 2026, federal long-term capital gains brackets are:
- 0% on taxable income up to $98,900
- 15% on taxable income from $98,900 to $614,050
- 20% on taxable income above $614,050
The first catch is that the income used for these thresholds is not just your capital gains. It includes all of your other income too. Your wages, interest, and bonuses fill up the lower brackets first, and your capital gains sit on top.
Take a married couple in California earning $500,000 in combined salaries. Because their salaries already put their taxable income well past $98,900, the very first dollar of stock they sell starts in the 15% federal capital gains bracket. Their total income is also well over the $250,000 threshold for NIIT, so they add 3.8% on top of that. That gives 18.8% federally. Add California's 9.3% state tax (California taxes capital gains at ordinary rates), and they expect to pay a flat 28.1% on their stock sale.
So where does the extra 10 percentage points come from? It comes from deductions. For households that itemize deductions rather than taking the standard deduction, one large write-off is SALT (State and Local Taxes), which lets you deduct state income taxes and property taxes from your taxable income. Under 2026 rules, the SALT deduction is capped at $40,400 for joint filers. If you paid $50,000 in state and property taxes in 2026, you can only deduct $40,400.
That $40,400 cap starts to phase out once your Modified Adjusted Gross Income (MAGI, which for most households is the same as Adjusted Gross Income, or AGI, your total income before deductions) crosses $505,000. For every $1 of additional income above $505,000, the cap drops by 30 cents, until your income reaches $606,333 and it bottoms out at $10,000.
Here is what happens when our $500,000-salary couple sells stock (assuming they already have enough mortgage interest, property tax, and state income tax to stay above the standard deduction):
- Their first $5,000 of capital gains keeps their AGI under $505,000. Nothing phases out, so they pay the expected 28.1% (18.8% federal + 9.3% California).
- Once gains pass $5,000, their total income crosses $505,000. Because capital gains count toward AGI, every $1 of stock they sell reduces their SALT deduction by $0.30.
- When your deductions shrink by $0.30, $0.30 more of your income becomes taxable. For a couple earning $500,000, the top slice of their W-2 salary sits in the 32% federal ordinary bracket:$0.30 lost deduction × 32% ordinary bracket = +9.6% extra federal taxThat raises their federal rate on long-term capital gains from 18.8% to 28.4%.
- Add California's 9.3% base rate and their combined marginal rate jumps to 37.7%. Once gains pass $16,000, California's own itemized deduction phaseout (+0.56%) and exemption credit phaseout (+0.48%) kick in as well, pushing the total rate to 38.7% (and settling to 38.3% once the exemption credit finishes phasing out).
- Once gains reach $106,333 (bringing AGI to $606,333), the SALT cap hits its $10,000 floor. There is nothing left to phase out, the 9.6% extra federal tax disappears, and their marginal rate drops by nearly 10 percentage points.
In the chart below, the horizontal axis shows how much stock they sell ($0 to $120,000), and the height of the shaded area shows the marginal tax rate on the next dollar at each level. Hover over any point to see the exact breakdown (full LTCG & SALT Phaseout Case Study).
Selling stock silently shrank a state-tax deduction, which increased the tax on their W-2 wages. And once the deduction bottomed out, earning more money actually lowered their marginal tax rate, breaking assumption #2.
Why phaseouts and cliffs exist
Federal and state tax codes do two jobs at once. They raise revenue, and they run dozens of targeted spending programs: healthcare subsidies (ACA Premium Tax Credits, Medicare IRMAA), retirement exclusions (Social Security, Senior Deductions), family credits (EITC, Child Tax Credit), and deductions like SALT.
Every targeted benefit runs into the same budget math. Suppose lawmakers want to pass a $10,000 benefit for low- and middle-income households, with a $300B annual budget. Giving $10,000 to all ~160 million filers would cost $1.6T, so the benefit has to be taken away above some income threshold X. Mathematically, there are only two ways to write that rule:
A hard cliff
Draw a sharp cutoff at income X: earn X or less and keep $10,000; earn X + $1 and get $0. That single extra dollar carries a 1,000,000% marginal rate and leaves the household $9,999 poorer, breaking assumption #3.
A linear phaseout
To avoid a cliff, reduce the benefit gradually, say by $0.20 for every $1 of income above X until it hits $0 at X + $50,000. Inside that $50,000 window, a taxpayer in the 22% bracket pays 22 cents in regular tax and loses 20 cents of benefit on every additional dollar. Economically, losing a 20-cent benefit is the same as a 20% surtax, so their true marginal rate is 42%.
Then, on dollar 50,001 above X, the benefit reaches $0. There is nothing left to claw back, the 20% penalty shuts off, and the marginal rate drops from 42% back down to 22%, breaking assumption #2.
Targeting any tax benefit by income under a budget cap forces one of these two outcomes: a cliff (earning $1 leaves you poorer) or a phaseout (your marginal rate spikes inside the window and falls once you pass it). Some provisions even combine both. Under 2026 rules, ACA healthcare subsidies phase out gradually from 100% to 400% of the Federal Poverty Level, and then drop off a hard cliff at 400% FPL for whatever subsidy remains.
Two more real-world examples
Because almost every phaseout and cliff watches Adjusted Gross Income (AGI) or a variant of it, earning a dollar in one place can set off a chain reaction somewhere completely unrelated on your return. Here is how that plays out for early retirees and middle-class seniors.
Earning $1 more costs $26,600, then your rate drops to 4%
Take an early-retired married couple (ages 60 and 59) in North Carolina with $12,000 of baseline interest income, enrolled in an ACA Silver health plan. They sell long-term stock while sitting well inside the 0% federal capital gains bracket (full ACA Subsidy Cliff Case Study).
- Between $44,500 and $72,500 of capital gains, their required household healthcare contribution scales up with income, clawing back 10 to 19 cents of ACA subsidy per dollar of gain. Combined with North Carolina's ~4% flat tax, the “0% federal bracket” becomes a 14% to 23% marginal bracket.
- At $72,700 of gains, their Modified AGI ($12,000 interest + $72,700 gains) crosses 400% of the Federal Poverty Level ($84,700). Under the rules returning in 2026, crossing 400% FPL by $1 removes the repayment cap and drops their allowed healthcare subsidy to $0, meaning they have to pay back the entire year's subsidy on their tax return. That adds over $26,600 in tax on a single dollar of gains. (Switch to the Average Tax Rate tab below to watch their average rate jump from 8% to 44%.)
- Past the cliff, there is no subsidy left to lose. Subsequent gains pay only ~4% North Carolina tax until the 15% federal bracket starts near $119,000.
Paying nearly double your bracket, plus single-dollar cliffs
Now consider a single 71-year-old retiree in Minnesota receiving $35,000 of Social Security who withdraws money from a Traditional IRA (full Social Security Torpedo Case Study).
- Once a single retiree's “Provisional Income” (an IRS formula that combines half of Social Security with other income) passes $34,000, every $1 withdrawn from a Traditional IRA pulls $0.85 of previously tax-free Social Security into taxable income, raising taxable income by $1.85.
- From $18,200 to $45,500 of IRA withdrawals, that 1.85× multiplier turns the 10% and 12% federal brackets into 18.5% and 22.2% (24% to 28% with Minnesota state tax). It briefly spikes to 48.5% when they enter the 22% bracket just before hitting the 85% Social Security ceiling, compounded by the 2026 Senior Deduction's 6% phaseout once total AGI crosses $75,000.
- Past $57,000 of withdrawals, they hit ten smaller cliffs every $4,000 from Minnesota's state rules (~$200 each). Near $79,400 of withdrawals, MAGI crosses $109,000 and triggers the federal Medicare IRMAA cliff ($1,150+ in annual surcharges on $1 of income, billed two years later under IRMAA's two-year lookback).
Thresholds from $25,000 to $10,000,000
If the tax code used one unified phaseout threshold, planning around it would be straightforward. Instead, Congress and 50 state legislatures tuned each program separately to hit that year's budget score, indexing some thresholds to inflation and leaving others frozen in 1980s or 2010s dollars. The table below is just a small sample of the thresholds across the tax code (there are dozens more, including the Child Tax Credit, Roth IRA contribution limits, education credits, and the QBI deduction):
| Income Threshold | Provision Phased In/Out | Hidden Marginal Tax Mechanism |
|---|---|---|
| $25,000 (Single) $32,000 (Joint) | Social Security Benefit Taxation | Enacted in 1983/1993 and never indexed to inflation. Pulls $0.50 to $0.85 of Social Security into taxable income per $1 of other income. |
| 100% to 400% FPL (~$21k–$84.7k Couple) | ACA Healthcare Subsidies | Sliding-scale subsidy clawback (10%–19% hidden tax rate), followed by a hard repayment cliff at 400% FPL. |
| $75,000 (Single) $150,000 (Joint) | 2026 Senior Deduction | Claws back the $6,000 senior deduction at 6 cents per dollar above the threshold. |
| $109,000+ (Single) $218,000+ (Joint) | Medicare IRMAA Surcharges | Five discrete step-function cliffs where $1 of extra MAGI triggers $1,000 to $5,000+ in annual Medicare premium surcharges (with a two-year lookback). |
| $505,000 (Single & Joint) | 2026 SALT Deduction Cap Phaseout | Claws back the $40,400 SALT deduction cap by 30 cents per dollar down to a $10,000 floor (ending at $606,333 AGI). |
| ~$1,000,000+ (Joint) | Federal AMT Exemption Phaseout | Claws back 25 cents of the Alternative Minimum Tax exemption per $1 of income, turning the 28% AMT rate into a 35% bubble bracket. |
| $10,000,000+ (NY AGI) | New York Itemized Deduction Reduction | Taxpayers with NY AGI over $10M have itemized deductions cut so allowable deductions equal only 25% of their federal charitable deduction. |
Because “high income” starts at $25,000 in one rule and $10,000,000 in another, almost every household runs into phaseouts, and many sit inside several overlapping windows at once.
Different definitions of income and 50 state codes
At this point you already have the main mechanics that affect most households. Beyond phaseouts and cliffs, there are a few stranger rules built into federal and state law, starting with the fact that lawmakers have not even agreed on how to measure “income”:
- At least 7 different “Modified AGIs” in the federal code: There is no single line on a tax return for Modified Adjusted Gross Income (MAGI). Different programs define their own add-backs to AGI. ACA subsidy MAGI adds back tax-exempt municipal bond interest, foreign earned income, and untaxed Social Security. Roth IRA MAGI ignores untaxed Social Security and municipal bonds, but adds back student loan interest and IRA deductions. The Child Tax Credit, Net Investment Income Tax, Medicare IRMAA, and Passive Activity Loss rules each maintain their own separate definition.
- 41 income-tax states, 41 definitions of income: Out of the 41 states with broad individual income taxes, ~31 start with Federal AGI and apply dozens of state-specific additions and subtractions, 5 start with Federal Taxable Income, and 5 (including Pennsylvania and New Jersey) ignore the federal starting point and define income from scratch. Even AGI-conforming states diverge quickly: Arizona's return has over 22 separate subtraction lines, followed by a catch-all “Other Subtractions from Income” box.
- Staircase cliffs every $4,000: On the Minnesota retiree chart above, between $57,000 and $93,000 of IRA withdrawals, sharp vertical spikes appear every $4,000. Minnesota wrote its Social Security subtraction phaseout as a discrete step function: the deduction drops by 10% for each $4,000 block of income above the threshold. Crossing a $4,000 boundary by $1 wipes out 10% of the state deduction (~$2,975) at once, adding ~$200 of state tax on a single dollar. Across that $40,000 range, the staircase acts like an extra ~5% marginal rate ($200 ÷ $4,000).
- New York's “Tax Table Benefit Recapture”: Everyone learns that entering a higher bracket only taxes new dollars at the higher rate while earlier dollars keep their lower rates. New York State breaks that rule. For a single filer, once NY AGI passes $107,650, each bracket jump triggers a $50,000 phase-in window that claws back the tax savings from all lower brackets until every dollar of your taxable income, starting from the first, is taxed at that bracket's rate. At $107,650, recapture adds ~1.1% to the marginal rate. When a single filer crosses $1,077,550 (where NY's rate jumps from 6.85% to 9.65%), New York claws back $30,172 of lower-bracket savings across just $50,000 of income (+60.34%):37.00% Fed + 9.65% NY Base + 60.34% NY Recapture ($30,172 ÷ $50k) + 3.88% NYC = 110.87%Across that $50,000 stretch, an extra dollar earned in New York City leaves the earner worse off after tax.
- The Federal-State deduction loop (in tax planning): Federal itemizers deduct state income tax paid during the calendar year (cash basis), while three states (Alabama, Missouri, and Oregon) let taxpayers deduct some or all of their federal tax liability on their state return. When you file after year-end, there is no loop: whatever state tax you paid by December 31 is already fixed, so you compute your federal return first and carry that number to your state return.
The circular dependency shows up when planning ahead or modeling marginal rates, where withholding and estimated payments are calibrated so state tax paid matches state tax owed:
Federal Tax Liability depends on State Tax PaidState Tax Owed depends on Federal Tax LiabilityOnce state tax paid tracks state tax owed, every $1 change in federal tax alters your state deduction, which alters your state tax, which alters your federal SALT deduction. Settling both returns together requires fixed-point iteration.
How to find your own marginal tax rate
After looking at income stacking, SALT phaseouts, ACA cliffs, Social Security taxation, 7 definitions of MAGI, and 50 different state rulebooks, the core problem is pretty clear: it is very hard to know your actual marginal tax rate ahead of time.
You cannot read it off an IRS bracket table. Even a well-built personal spreadsheet runs into two problems: it only models the rules you already thought to include (making it easy to miss a state itemized deduction phaseout, AMT, or a new 2026 rule like the SALT cap or Senior Deduction phaseout when your income changes), and it usually evaluates one scenario at a time rather than sweeping across a range to reveal a cliff sitting just above your planned sale. Standard tax filing software has the same single-point limitation: it tells you what you owe for one specific set of numbers, not whether a $10,000 stock sale or Roth conversion is about to push you into a hidden 10% phaseout or off a $26,600 cliff.
To actually see where those bumps and cliffs sit around your income, you have to run the full federal, state, and benefit rules across a whole range of income levels and measure how much your total tax changes at each step (Δtax ÷ Δincome). That is how each chart in this article was built, by evaluating the full rulebook at 500 evenly spaced points along the horizontal axis. (For sharp cliffs, the step size matters: on the North Carolina chart, a $26,625 tax jump across a $240 step shows up as an 11,094% spike, and as the step approaches $1, a true cliff approaches infinity.)
Until recently, running the complete federal and 50-state tax code required expensive, closed-source commercial software. Today there are two practical ways to do it yourself:
- PolicyEngine (Python): PolicyEngine (
policyengine-us) is an open-source microsimulation engine built for tax and benefit policy research. It encodes the federal tax code, all 50 state tax codes, and major benefit programs (ACA subsidies, Medicare IRMAA, Social Security taxation, and more), and is validated extensively against NBER's TAXSIM model, which it is set to replace from 2026 onward. If you are comfortable writing Python scripts, you can model any household directly. - TaxVant (web planner): TaxVant is built on top of PolicyEngine so you can run these income and deduction sweeps visually without writing custom scripts. Every chart in this article links directly to the live planner with no account or signup required, letting you plug in your own numbers and see which federal and state rules are driving your curve.
Whether you write your own scripts or use a planner, it pays to look at your actual marginal tax curve before making a major financial decision like selling appreciated stock, doing a Roth conversion, or planning retirement withdrawals. Tax brackets are a useful starting point, but they rarely tell you what your next dollar will really cost.