Investing & Retirement Long-form guide

Capital gains tax — long-term vs short-term, brackets, basis, and NIIT

How US capital gains tax is computed: the holding-period line, the 0/15/20 percent long-term brackets, the 3.8 percent NIIT, basis, and the planning levers.

CC
Author

Cristian Corrales

Founding editor of finbarrow. Math-first analysis of US personal finance, anchored to primary sources (CFPB, FDIC, FRB, IRS, FICO, FINRA, SEC, NCUA).

Published · Last reviewed · 17-minute read
Brass scale balance on cream paper with mustard-gold coins labeled long-term on one pan and a navy coin labeled short-term on the other — capital gains tax holding period explained.

Capital gains tax is one of the small set of US tax provisions where the same dollar of income can be taxed at materially different rates depending on small choices the taxpayer makes. A single day of holding period can shift gain from 37% (top ordinary rate) to 20% (top long-term capital gains rate). A modest change in taxable income can pull gain across the 0%-to-15% bracket line. A different choice of which lot of stock to sell can produce a much smaller — or much larger — taxable gain on the same total transaction. Capital gains tax planning is therefore one of the highest-leverage personal-finance topics, and is also one of the most consistently misunderstood, because the rates and rules differ materially from how ordinary income is taxed.

This guide walks through how US capital gains tax is computed: the holding-period line that separates long-term from short-term gain, the three long-term brackets (0%, 15%, 20%) and the taxable-income thresholds that gate each, the Net Investment Income Tax (NIIT) that adds 3.8% above MAGI thresholds, how cost basis is established and adjusted, the wash sale rule that disallows artificial losses, state-level treatment, and the major planning levers that ordinary US investors can use to control the tax bill on long-held assets. Every threshold and rate cited is sourced to IRS publications listed at the end.

The holding-period line — one year and one day

The first decision the tax code makes about a capital gain is whether it is long-term or short-term. The dividing line is the holding period, defined in Internal Revenue Code Section 1222 and the regulations underneath it.

The holding period begins the day after the trade date on which the asset was acquired (not the settlement date, which can be 1-2 business days later under T+1 rules). The holding period ends on the trade date of the sale. An asset whose computed holding period is more than one year — meaning at least one year and one day — produces long-term gain or loss. An asset held for one year or less produces short-term gain or loss.

The day-counting rule matters most at the boundary. A stock purchased on March 5, 2025, must be sold on March 6, 2026, or later to qualify for long-term treatment. Selling on March 5, 2026, produces short-term gain — the holding period is exactly 365 days, which is not “more than one year”. Brokerages display the holding-period qualification status in trade confirmations and on the Form 1099-B at year end; the filer should verify the classification against the trade-date math when the answer matters at the margin.

The classification is consequential because the rates are very different. Short-term capital gain is taxed at the filer’s ordinary income rate — the same brackets that apply to W-2 wages, ranging from 10% to 37% in 2025. Long-term capital gain is taxed at one of three preferential rates: 0%, 15%, or 20%. The maximum spread between short-term and long-term treatment is therefore 17 percentage points (37% versus 20%), which on a $100,000 gain is $17,000 of federal tax difference for the cost of holding the position 366 days instead of 365.

Holding-period extension is one of the lowest-effort tax planning moves available. An investor with a position near the one-year line who is contemplating a sale should generally hold past the boundary unless there is a strong reason to sell sooner — the option value of long-term treatment is typically worth several percentage points of expected price movement.

The three long-term brackets — 0%, 15%, 20%

Long-term capital gains tax has three brackets, applied to the filer’s taxable income (Form 1040 line 15), not to AGI and not to gross income. The table below shows both the 2025 thresholds (returns filed in early 2026) and the confirmed 2026 thresholds (returns filed in early 2027), from IRS Rev. Proc. 2024-40 and Rev. Proc. 2025-32:

Filing statusYear0% bracket15% bracket20% bracket
Single2025up to $48,350$48,351 – $533,400above $533,400
Single2026up to $49,450$49,451 – $545,500above $545,500
Married filing jointly2025up to $96,700$96,701 – $600,050above $600,050
Married filing jointly2026up to $98,900$98,901 – $613,700above $613,700
Head of household2025up to $64,750$64,751 – $566,700above $566,700
Head of household2026up to $66,200$66,201 – $579,600above $579,600
Married filing separately2025up to $48,350$48,351 – $300,000above $300,000
Married filing separately2026up to $49,450$49,451 – $306,850above $306,850

The brackets are indexed for inflation each year, and they are tested against taxable income (after the standard or itemized deduction), not against AGI or modified AGI. That distinction matters because the 3.8% net investment income tax discussed below keys off modified AGI instead — so the same dollar of gain is measured against two different income definitions by the two taxes.

The 0% bracket is the most important planning insight for many households — the 0% capital gains harvest strategy covers who qualifies and how to execute it. The mechanics of which bracket applies depend on the filer’s total taxable income (ordinary plus capital gains), not on the capital gain alone. The capital gain stacks on top of ordinary income; the part of the gain that fits within the 0% bracket pays 0%, the part that fits within the 15% bracket pays 15%, and the part in the 20% bracket pays 20%.

A worked example: a single filer with $40,000 of ordinary taxable income realizes a $20,000 long-term capital gain. The first $8,350 of the gain fits within the 0% bracket (since $40,000 + $8,350 = $48,350, the top of the 0% bracket for single filers in 2025). The remaining $11,650 of the gain pushes into the 15% bracket and is taxed at 15%, for $1,748 of federal capital gains tax. The same $20,000 gain at $200,000 of ordinary taxable income would be fully in the 15% bracket and would produce $3,000 of federal capital gains tax. At $700,000 of ordinary taxable income, the entire gain would be in the 20% bracket and would produce $4,000 of federal capital gains tax.

The 0% bracket is the most important planning insight for many households. A married couple in early retirement with $80,000 of taxable income from withdrawals and Social Security has roughly $18,900 of “0% capital gains headroom” before the 15% bracket starts, since the 2026 married-filing-jointly 0% ceiling is $98,900. They can sell $18,900 of appreciated index funds, realize the gain, pay zero federal capital gains tax, and immediately rebuy the position (no wash sale rule on capital gains, only on losses) — a strategy called the “0% capital gains harvest” that resets basis upward without tax cost. Doing this annually can move tens of thousands of dollars of latent gains into already-taxed basis, reducing future tax bills when withdrawals at higher income years would otherwise be taxed at 15% or 20%.

Short-term gains use the ordinary income brackets

Short-term capital gain is taxed at the same rates as W-2 wages, self-employment income, interest, and other ordinary income. The 2025 ordinary income brackets for single filers run 10% (up to $11,925), 12% (to $48,475), 22% (to $103,350), 24% (to $197,300), 32% (to $250,525), 35% (to $626,350), and 37% above. Married filing jointly brackets are roughly double the single brackets at the lower end but compress at the top.

The implication: an active trader who consistently produces short-term gains is exposing those gains to the ordinary income rate, which for a typical middle-income filer is 22% or 24%, well above the 15% long-term rate that would apply to the same gain held more than a year. The “tax cost of short-term trading” can be approximated as the spread between the filer’s marginal ordinary rate and the 15% long-term rate, multiplied by the realized gains. For a 24%-marginal-rate filer, every $10,000 of short-term gain costs $900 more in federal tax than the same gain would have cost as long-term. Over a year of active trading producing $50,000 of short-term gains, that is $4,500 of tax cost specifically attributable to the holding-period treatment.

The math works against active trading even before considering the transaction costs and the well-documented difficulty of consistently outperforming a buy-and-hold strategy. The holding-period tax penalty is one of the structural reasons that index investing tends to compound faster than active trading for typical retail investors.

The 3.8% Net Investment Income Tax surtax

The Net Investment Income Tax, enacted in 2013 to fund the Affordable Care Act, adds a 3.8% surtax on net investment income for higher-income filers. The thresholds:

Filing statusNIIT MAGI threshold
Single, head of household$200,000
Married filing jointly$250,000
Married filing separately$125,000

The NIIT applies to the lesser of (a) net investment income (capital gains, dividends, interest, rental income, royalties, passive business income) or (b) MAGI in excess of the threshold. The surtax is calculated on a separate form (Form 8960, walked line by line) and stacks on top of the regular capital gains rate, producing effective rates of:

  • 15% LTCG + 3.8% NIIT = 18.8% combined federal rate
  • 20% LTCG + 3.8% NIIT = 23.8% combined federal rate
  • For short-term gain at the 35% ordinary rate + 3.8% NIIT = 38.8% combined federal rate

The NIIT-specific MAGI starts from regular AGI and adds back the foreign earned income exclusion (uncommon for most filers). For typical US-source-income filers, NIIT MAGI is effectively the same as AGI from Form 1040 line 11 — see the AGI on Form 1040 line by line guide for the AGI computation.

The structurally important fact about NIIT is that the thresholds ($200K / $250K) are NOT indexed for inflation. They have been the same since enactment in 2013. Wage growth and inflation since 2013 have substantially increased the share of US households subject to NIIT — a phenomenon sometimes called “bracket creep” but specific to NIIT because of the non-indexation. A household earning $180,000 in 2013 was clearly below the single-filer NIIT threshold; the same household earning $230,000 a decade later (consistent with typical wage growth) is now subject to NIIT on investment income.

Cost basis — how it is computed and adjusted

Cost basis is the figure subtracted from the sale price to arrive at the capital gain. The basis math determines how much of the proceeds is actually taxed. Getting basis right is therefore as important as getting the rate right.

Initial basis is the purchase price plus any commissions or transaction fees paid to acquire the asset. For an investor who bought 100 shares of a stock at $50 plus a $5 commission, the basis is $5,005, and a sale at $80 ($8,000 proceeds) produces a gain of $2,995 — not $3,000.

Reinvested dividends raise basis. Mutual fund and ETF investors who reinvest dividends are effectively making additional purchases each quarter. Each reinvestment lot has its own basis (the price the dividend bought shares at). At sale, the total basis is the sum of the original purchase basis plus all reinvested dividend basis. Failing to track this produces double taxation: the dividend was already taxed in the year received; treating the resulting shares as having zero basis means the same money is taxed again on sale.

Capital improvements raise basis (for real estate). A homeowner who spends $50,000 on a kitchen renovation can add the cost to the basis of the home, reducing eventual capital gain on sale. The Section 121 primary residence exclusion ($250K single / $500K joint) often makes this moot for primary homes, but matters for rental property and for primary homes above the exclusion.

Depreciation lowers basis (for rental property). Annual depreciation taken against rental income reduces the property’s adjusted basis. On sale, the accumulated depreciation is “recaptured” at a 25% federal rate before regular capital gains rates apply to the remaining appreciation.

Specific identification at sale — the filer can choose which lot is sold. For multiple lots with different bases, selling the highest-basis lot minimizes the current-year gain (or maximizes the loss for tax-loss harvesting). Brokerages default to first-in-first-out (FIFO) for stocks and average cost for mutual funds; specific identification requires the filer to notify the broker before or at the time of sale.

The “step-up in basis at death” is the most consequential basis rule in US tax. When an asset passes to heirs through inheritance, the basis steps up to the fair market value on the decedent’s date of death (or the alternate valuation date six months later, in certain cases). All latent capital gain that accrued during the decedent’s lifetime is erased for tax purposes. An asset bought at $50,000 and worth $500,000 at death produces zero capital gains tax for the heir on a sale at that price — the $450,000 of latent gain is forgiven. The step-up makes “hold until death” the optimal strategy for highly-appreciated long-term assets owned by older taxpayers who do not need to sell during their lifetime.

The wash sale rule — disallowed losses

The wash sale rule does NOT apply to gains. The IRS taxes every realized gain regardless of how soon a replacement position is repurchased. The rule applies only to losses, and disallows a loss deduction when the investor purchases a “substantially identical” security within the 30-day window before or 30-day window after the loss sale.

The 61-day rule (30 + 1 + 30) means tax-loss harvesting requires either holding cash for 31 days after the loss sale or replacing the security with one that is not substantially identical. For broad-market index funds, this typically means switching between similar but distinct funds (e.g., Vanguard VTSAX for Fidelity FZROX, or VTI for ITOT). The tax-loss harvesting in taxable accounts guide covers the operational details. The wash sale rule glossary entry summarizes the IRS-specific definitions.

Because the rule does not apply to gains, the “0% capital gains harvest” strategy mentioned earlier — selling appreciated long-term positions in the 0% bracket and immediately rebuying — is unambiguously allowed. The IRS specifically does not police gain-realization patterns the way it polices loss-realization patterns.

State capital gains treatment

The federal capital gains framework above is the dominant rate consideration for most US filers, but state income tax adds another layer.

Most states tax capital gains as ordinary income — there is no state-level preferential rate for long-term gains. A California filer in the top state bracket pays 13.3% state tax on every dollar of capital gain, long-term or short-term. A New York City filer pays NY state tax (up to 10.9%) plus NYC tax (up to 3.876%). The federal-plus-state combined rate on a top-bracket California long-term gain is therefore 20% + 3.8% NIIT + 13.3% state = 37.1% combined.

Several states have no income tax at all, eliminating the state-level capital gains burden entirely: Florida, Texas, Tennessee, Washington (with a specific exception for capital gains over $250K starting in 2022 — a state-level capital gains tax that several other states do not have), Wyoming, South Dakota, Nevada, Alaska, and New Hampshire (which previously taxed only interest and dividends — that tax was repealed effective 2025).

A few states have preferential treatment for long-term gains. Arkansas exempts a portion of long-term gain from state tax. Hawaii caps the long-term capital gains rate at 7.25%, lower than the top ordinary income rate. New Mexico provides a partial deduction.

The implication for state-of-residence planning: a household contemplating a large gain (sale of a business, sale of highly appreciated stock, sale of investment real estate) can save substantial state tax by establishing residency in a no-income-tax state before the realization. The mechanics of state residency for tax purposes (183-day rules, domicile factors, audit risk) are state-specific and worth professional advice when the sums involved are large.

Worked example — selling appreciated stock

Consider a married couple filing jointly with the following picture in tax year 2025:

  • Wages and ordinary income: $180,000
  • Long-term capital gain from selling 1,000 shares of VTSAX held 8 years, originally purchased at $80/share, sold at $260/share: 1,000 × ($260 − $80) = $180,000 gain
  • Qualified dividends from other holdings: $4,000

Step 1: Compute taxable income excluding the capital gain. AGI is roughly $184,000 (wages plus dividends, minus a few above-the-line adjustments we will assume to be $10,000 from 401(k) and HSA contributions). Standard deduction $30,000. Taxable income excluding cap gain ≈ $154,000.

Step 2: Stack the long-term capital gain on top of ordinary taxable income for bracket purposes. $154,000 + $180,000 + $4,000 (qualified dividends are taxed at LTCG rates) = $338,000 total taxable income on Form 1040 line 15.

Step 3: Apply the brackets to the $184,000 of long-term gain plus qualified dividends:

  • The first $96,700 of the gain bracket stack is in the 0% bracket — but the ordinary taxable income of $154,000 has already filled and exceeded the 0% bracket. So zero of the gain gets the 0% rate.
  • The next portion fits within the 15% bracket, which runs to $600,050. The gain stack from $154,000 to $338,000 ($184,000 of gain plus dividends) all fits within the 15% bracket.
  • Federal capital gains and qualified dividend tax: $184,000 × 15% = $27,600.

Step 4: Check NIIT. MAGI is approximately $184,000; the MFJ threshold is $250,000. MAGI is below the threshold, so NIIT does NOT apply to this couple. (If wages had been $250,000 instead of $180,000, MAGI would be $254,000, and NIIT would apply to the lesser of net investment income ($184,000) or MAGI excess ($4,000) — so 3.8% × $4,000 = $152 of NIIT. Small at the threshold; grows fast above it.)

Step 5: State tax. Assume California residency. State tax on the gain (no preferential treatment) at the top bracket marginal rate of 9.3% to 13.3%, depending on total income. Approximately $20,000 of state tax.

Federal total on the gain: $27,600. State total: roughly $20,000. Combined: ~$47,600 of tax on $180,000 of gain, an effective combined rate of ~26%.

The same gain realized in a no-income-tax state (Florida, Texas) would skip the $20,000 state portion. The same gain realized while the household has lower ordinary income (e.g., a gap year between jobs, or in early retirement before Social Security and RMDs start) could put a substantial portion in the 0% bracket, dramatically reducing the federal portion.

Planning levers — what an ordinary investor can control

Six planning levers control federal capital gains tax for the typical US investor:

1. Holding period management. Hold past 366 days to qualify for long-term treatment. The 17 percentage point maximum spread is the highest-leverage decision in the entire framework.

2. Realization timing. Realize gains in low-income years (early retirement, sabbatical, year of large above-the-line deductions) to stack them in the 0% or 15% bracket rather than at the top of ordinary income. The flip side: defer gains in high-income years (peak earning years, year of large bonus) where the gain would stack into the 20% bracket plus NIIT.

3. Specific identification at sale. When a position has multiple lots, sell the highest-basis lots to minimize current-year gain. Tell the broker before or at the trade.

4. Tax-loss harvesting. Realize available losses to offset realized gains dollar-for-dollar. Up to $3,000 of net loss per year can offset ordinary income. Losses above the offset carry forward indefinitely. The TLH guide covers the wash-sale interaction.

5. Charitable giving of appreciated assets. Donating long-held appreciated stock directly to a qualified charity (or to a donor-advised fund) lets the donor take a Schedule A deduction at the fair market value AND avoid the capital gain on the donated shares. The combined benefit can substantially exceed donating the same dollar amount in cash.

6. Step-up at death. For highly appreciated long-term assets that the household does not need to sell during life, holding until death erases the latent gain entirely for the heirs. This is the strongest argument for the “buy and hold forever” thesis at the household level.

What this guide does not cover

This guide focused on US federal and state capital gains tax mechanics for typical investors. It does not cover:

  • Section 1031 like-kind exchanges for real estate, which defer capital gains tax on investment property when replacement property is acquired within strict timelines.
  • Qualified Small Business Stock (QSBS) exclusion under Section 1202, which can exempt up to $10 million of gain from federal tax on qualifying small business equity held 5+ years.
  • Section 1244 stock loss treatment for small business stock losses.
  • Collectibles capital gains rate (28% federal rate on collectibles, gold, art, coins), which differs from the standard LTCG framework.
  • Depreciation recapture mechanics on rental real estate sales in detail (25% federal recapture rate before regular LTCG rates apply).
  • Cryptocurrency capital gains treatment (currently follows the general capital gains framework but with specific reporting requirements and rapidly-evolving IRS guidance).
  • International tax treatment for US citizens and residents holding foreign assets, including FBAR and Form 8938 reporting requirements.

Each of the above is a substantial topic in its own right.

Sources

Frequently asked

Quick answers

What is the difference between long-term and short-term capital gains?

The holding period is what separates the two, and the line is exactly one year and one day. An asset sold after being held for more than one year produces long-term capital gain, taxed at the preferential federal rate of 0%, 15%, or 20% depending on the filer's taxable income. An asset sold at one year or less of holding produces short-term capital gain, taxed at the filer's ordinary income rate (the same brackets that apply to W-2 wages, 10% through 37% in 2025). The holding period is counted from the day after the purchase trade date to the day of the sale trade date — the purchase date itself does not count. The single-day difference between 365 and 366 days of holding can move the same dollar of gain from a 37% ordinary rate to a 20% long-term rate, which is the largest tax-arbitrage opportunity that average investors routinely encounter.

What are the 2025/2026 long-term capital gains tax brackets?

The long-term capital gains tax has three brackets — 0%, 15%, and 20% — applied to the filer's taxable income (not gross income, not AGI). For 2025 the 0% bracket reaches taxable income of $48,350 (single), $96,700 (married filing jointly), and $64,750 (head of household); for 2026 those 0%-bracket ceilings rise to $49,450, $98,900, and $66,200 respectively, per IRS Rev. Proc. 2024-40 and Rev. Proc. 2025-32. Above the 0% bracket, the 15% bracket runs up to $533,400 single and $600,050 MFJ for 2025 ($545,500 and $613,700 for 2026), and the 20% bracket applies above that. The 0% bracket is the most important planning insight for many households — a married couple with taxable income under the joint ceiling can realize long-term gains at zero federal tax, the foundation of the "0% capital gains harvest" strategy.

When does the 3.8% net investment income tax (NIIT) apply on top of capital gains?

The Net Investment Income Tax adds a 3.8% surtax on top of the regular capital gains rate when two conditions are met: the filer has investment income (capital gains, dividends, interest, rental income), AND the filer's modified adjusted gross income exceeds the NIIT thresholds — $200,000 (single, head of household), $250,000 (married filing jointly), $125,000 (married filing separately). The NIIT is applied to the lesser of the investment income or the MAGI excess over the threshold. So a single filer with $50,000 of long-term gains and $230,000 of MAGI pays the 15% LTCG rate plus 3.8% NIIT on the $30,000 of MAGI above the threshold (not on the full $50,000), producing an effective rate of 15% on the first $20,000 of gain and 18.8% on the next $30,000. The thresholds are NOT indexed for inflation, which means more households become subject to NIIT each year as wages drift up.

How is the cost basis of a stock determined for capital gains tax?

Cost basis is generally the purchase price plus any commissions or fees paid to acquire the asset. For shares purchased in multiple lots over time, basis is tracked per lot — the IRS allows specific identification (the filer tells the broker which lots to sell) or default methods (first-in-first-out, average cost for mutual funds). Basis is adjusted upward for reinvested dividends (already taxed when paid; raising basis prevents double taxation on the same dollars), capital improvements (for real estate), and certain return-of-capital distributions. Basis is adjusted downward for accumulated depreciation on rental property. For inherited assets, the basis steps up to the fair market value at the decedent's date of death — a major planning insight that often makes "hold until death" the optimal strategy for highly-appreciated assets. Brokerages are required to report cost basis to the IRS on Form 1099-B for "covered" securities (acquired post-2011 for stocks, post-2012 for mutual funds and ETFs); for older lots the filer is responsible for documenting basis.


Educational content only. finbarrow is an independent editorial publication, not a licensed financial advisor, broker, tax preparer, or attorney. Verify rates and terms with the issuer or relevant regulator. See disclaimers and funding disclosures.

← Back to Investing & Retirement