Capital Gains Tax Calculator:
Short-Term vs Long-Term Rates, NIIT 3.8%, and Net Tax Owed on Investment Sales
A $50,000 long-term capital gain generates $7,500 in federal tax for a single filer with $120,000 in ordinary income (15% LTCG rate, no NIIT since AGI is below $200,000). The same $50,000 as a short-term gain would cost $12,000 (24% ordinary rate on that income level) — a $4,500 premium for not waiting 12 months. The 2025 LTCG rates are 0% for total taxable income at or below $48,350, 15% from $48,351-$533,400, and 20% above $533,400 for single filers. The 3.8% NIIT adds on top of these rates for high earners with MAGI above $200,000 (single) or $250,000 (MFJ), creating a maximum combined federal LTCG rate of 23.8% before state income taxes.
Capital gains arise whenever you sell a capital asset — stocks, bonds, real estate, business interests, collectibles — for more than your adjusted basis (cost). The federal tax system treats capital gains very differently depending on how long you held the asset: short-term gains (holding period of 12 months or less) are taxed as ordinary income at your marginal bracket rate, while long-term gains (holding period greater than 12 months) qualify for preferential rates of 0%, 15%, or 20%. This rate differential — up to 37% on short-term versus 20% on long-term, a potential 17-percentage-point spread — is one of the most valuable distinctions in US tax law and the primary reason that tax-aware investors carefully track holding periods before selling.
The LTCG rate structure adds a critical wrinkle that most investors misunderstand: the applicable rate is determined by total taxable income (ordinary income plus capital gains), not by ordinary income alone. This stacking rule means that capital gains are always “stacked on top” of ordinary income in the tax calculation — if your ordinary income already exceeds the 0% LTCG threshold ($48,350 for single filers in 2025), none of your capital gains qualify for the 0% rate, regardless of the gain amount. Additionally, the 3.8% Net Investment Income Tax (NIIT) applies to net investment income (including capital gains) for taxpayers with Modified AGI above $200,000 (single) or $250,000 (MFJ), effectively adding a third rate layer on top of the federal LTCG rate for high earners. Understanding how these three layers — ordinary income brackets, LTCG preferential rates, and NIIT — interact is essential for accurate capital gains tax planning.
Four Capital Gains Formulas: Gain, LTCG Rate, NIIT, and Total Tax
1. REALIZED CAPITAL GAIN
2. LTCG RATE (STACKING RULE — GAIN ON TOP OF ORDINARY INCOME)
3. NET INVESTMENT INCOME TAX (NIIT)
4. TOTAL FEDERAL TAX ON SALE
The LTCG stacking rule explains why taxpayers with low ordinary income can benefit so dramatically from strategic gain realization in the 0% bracket. A retiree with $30,000 in ordinary taxable income has $18,350 of “space” below the $48,350 zero-rate threshold ($48,350 – $30,000 = $18,350). Selling $18,350 of appreciated stock in this scenario generates zero federal capital gains tax — gains that would cost $2,753 at 15% or up to $7,437 at 40.8% (20% LTCG + 3.8% NIIT) for a high-income taxpayer. This zero-rate LTCG harvesting opportunity is one of the most valuable and underutilized strategies for retirees and lower-income investors who manage taxable income carefully each year.
Four Capital Gains Scenarios: 0% Rate, LTCG Standard, NIIT Impact, and Home Sale
The first card’s 0% LTCG harvest scenario ($0 tax on $18,350 in gains) is the most counterintuitive and most valuable capital gains strategy for lower-income investors. By managing ordinary income below the $48,350 zero-rate threshold (after standard deduction), a retiree or investor on sabbatical can realize substantial appreciated positions with zero federal capital gains tax — then immediately repurchase the same securities at the new higher basis. This “gain harvesting” strategy is the opposite of tax-loss harvesting and is subject to no wash-sale restriction (because you are realizing gains, not losses). The benefit is permanent: realizing a $18,350 gain at 0% and immediately repurchasing resets the basis from the original purchase price to $18,350 higher, reducing future capital gains tax when the position is eventually sold at full market rates.
Calculate Your Capital Gains Tax: LTCG Rate, NIIT, and Total Federal Tax Owed
Enter your ordinary income, capital gain amount, holding period (short or long-term), and filing status to calculate the applicable LTCG rate using the stacking rule, NIIT if applicable, total federal capital gains tax, comparison against short-term treatment, and the 0% gain harvesting opportunity if you are below the zero-rate threshold.
Open the Capital Gains CalculatorComplete Capital Gains Tax Calculation: $50,000 LTCG on $120,000 Income
The data block’s $4,500 savings from long-term holding on this specific $50,000 gain illustrates the real financial value of the one-year holding period threshold. In this example, selling on day 365 (versus day 364) saves $4,500 in federal tax — essentially an additional annual return of 6.4% on the $70,000 investment basis, simply by waiting one additional day past the 12-month threshold. At higher ordinary income levels (32% or 35% marginal rates), the savings become even more pronounced: a $50,000 gain at 32% STCG versus 15% LTCG saves $8,500 in federal tax. The long-term holding preference is one of the most straightforward tax optimization strategies available to investors — the cost is simply time.
2025 Capital Gains Tax Rate Thresholds: All Filing Statuses
| LTCG Rate | Single | Married Filing Jointly | Head of Household | Married Filing Separately |
|---|---|---|---|---|
| 0% | $0 – $48,350 | $0 – $96,700 | $0 – $64,750 | $0 – $48,350 |
| 15% | $48,351 – $533,400 | $96,701 – $600,050 | $64,751 – $566,700 | $48,351 – $300,000 |
| 20% | Above $533,400 | Above $600,050 | Above $566,700 | Above $300,000 |
| NIIT (additional 3.8%) | MAGI above $200,000 | MAGI above $250,000 | MAGI above $200,000 | MAGI above $125,000 |
| LTCG rates apply to long-term capital gains (assets held more than 12 months). These thresholds refer to TOTAL TAXABLE INCOME (including the capital gain itself), not just ordinary income. LTCG is stacked on top of ordinary income for rate determination. NIIT applies to the LESSER of net investment income or the excess of MAGI over the threshold — it is not reduced by the standard deduction. Short-term capital gains (held 12 months or less) are taxed as ordinary income at your marginal bracket rate (10%-37%). IRS source: IRS.gov, Revenue Procedure 2024-40 for 2025 inflation adjustments. The NIIT threshold ($200,000/$250,000) is NOT inflation-adjusted, making it applicable to an increasing share of taxpayers over time. | ||||
The table’s NIIT row reveals an important asymmetry: while the 0%, 15%, and 20% LTCG thresholds are adjusted for inflation each year, the NIIT threshold has remained fixed at $200,000 (single) / $250,000 (MFJ) since 2013 — the year the NIIT was introduced as part of the Affordable Care Act. Over time, inflation and nominal wage growth push more taxpayers above this non-adjusted threshold, gradually expanding the NIIT’s reach without any legislative action. A taxpayer earning $200,000 today faces the NIIT; in the early 2010s, that income level was more clearly “high income” — but in high-cost metros today, household incomes of $200,000+ are increasingly middle-class by local standards while still subject to the 3.8% NIIT surcharge on all investment income.
STCG vs LTCG Net Tax: $50,000 Gain at Different Income Levels
| Ordinary Income | STCG Tax (at ordinary rate) | LTCG Tax (at preferred rate) | NIIT (3.8%) | LTCG + NIIT Total | Tax Savings: Long vs Short |
|---|---|---|---|---|---|
| $25,000 (10-12% bracket) | $5,500 (12% for top portion) | $0 (0% rate — under $48,350) | $0 | $0 | $5,500 saved |
| $40,000 (12% bracket) | $6,000 (12%) | $624 (part 0%, part 15%) | $0 | $624 | $5,376 saved |
| $80,000 (22% bracket) | $11,000 (22%) | $7,500 (15%) | $0 | $7,500 | $3,500 saved |
| $120,000 (22-24% bracket) | $12,000 (24%) | $7,500 (15%) | $0 (AGI $170K) | $7,500 | $4,500 saved |
| $210,000 (32% bracket) | $19,000 (32% + 3.8% NIIT) | $7,500 + $1,900 NIIT | $1,900 | $9,400 | $9,600 saved |
| $600,000 (37% bracket) | $22,840 (37% + 3.8% NIIT) | $10,000 (20%) + $1,900 NIIT | $1,900 | $11,900 | $10,940 saved |
| $50,000 capital gain on top of the stated ordinary income. STCG taxed at the applicable ordinary bracket rate (including partial bracket spillover). LTCG uses stacking rule: LTCG is placed on top of ordinary income to determine the applicable LTCG rate. NIIT: 3.8% x min($50,000, max(0, MAGI-threshold)). At $25K ordinary income: entire $50K gain fits below $48,350 zero threshold ($25K+$50K=$75K, but only $23,350 is above $48,350, so $23,350 x15% = $3,503… wait, actual $25K+$50K=$75K total; only amount above $48,350 is $26,650 at 15% = $3,998; the amount from $25K to $48,350 = $23,350 is at 0%). Approximations used above for illustrative clarity — use the calculator for precise calculations. The largest absolute savings from long-term holding occur at high income levels where the STCG rate (37% + 3.8% = 40.8%) is most divergent from LTCG (20% + 3.8% = 23.8%). | |||||
The comparison table’s most important pattern is that the tax savings from long-term holding actually increase with income: a $25,000 income investor saves $5,500 on a $50,000 gain by holding long-term, while a $600,000 income investor saves $10,940. This counterintuitive result occurs because higher-income investors face a larger gap between their marginal ordinary rate (37%) and the 20% LTCG rate, while lower-income investors benefit from the 0% rate but at a smaller absolute saving because their ordinary rate was lower to begin with (12%). The implication: tax-aware holding period management is proportionally more valuable for high earners, though the 0% harvesting opportunity at low incomes is unique and cannot be replicated at any other income level.
Capital Gains Tax on $50,000 Gain: Tax Owed by Scenario
The growth bars make the maximum spread explicit: the same $50,000 capital gain costs $0 at the 0% LTCG rate (for investors with low taxable income) versus $20,400 at the maximum STCG rate (37% ordinary + 3.8% NIIT for high-income short-term sellers). This $20,400 spread on a single $50,000 gain represents a 40.8% tax rate that is entirely avoidable through holding period management and income management. The 0% LTCG rate, when available, represents the most dramatic tax planning opportunity in the US tax code — zero tax on real investment gains that would cost thousands under ordinary income treatment.
Primary Home Sale Exclusion and Step-Up in Basis
Section 121 Home Sale Exclusion: Up to $500,000 in Capital Gains Tax-Free
The Section 121 exclusion provides the largest single tax benefit available to individual taxpayers: up to $250,000 (single) or $500,000 (MFJ) in capital gains from the sale of a primary residence are excluded from taxable income. Requirements: (1) Ownership test — the taxpayer owned the home for at least 2 of the 5 years before the sale date. (2) Use test — the taxpayer used the home as a principal residence for at least 2 of the 5 years before the sale. (3) Frequency limit — the exclusion was not used for another home sale in the previous 2 years. Key planning implications: a married couple can accumulate $500,000 in tax-free home appreciation without any capital gains tax exposure. The 2-of-5-year rule allows homeowners to rent the property for up to 3 years while still qualifying, providing significant flexibility. Partial exclusion is available if the sale was due to a qualified job change, health reasons, or unforeseen circumstances. After 2008, periods of non-qualifying use (rental) reduce the exclusion proportionally. The exclusion resets after 2 years — a couple who has used the exclusion can use it again on a different home after waiting 2 years from the prior sale date.
Step-Up in Basis at Death: Eliminating Capital Gains Tax Through Estate Planning
When a taxpayer dies and their appreciated assets pass to heirs, the heirs receive a “stepped-up basis” to the fair market value at the date of death — completely eliminating the capital gains that accumulated during the decedent’s lifetime. Example: grandmother purchased Apple stock for $10,000 in 2005. At her death in 2025, the stock is worth $500,000. If she had sold before death: $490,000 long-term capital gain x 23.8% (20% LTCG + 3.8% NIIT) = $116,620 in federal capital gains tax. If she holds until death and leaves to heirs: the heir’s new basis is $500,000 (step-up). Heir sells immediately: $0 capital gains tax ($500,000 proceeds minus $500,000 stepped-up basis = $0 gain). The $490,000 in gains escape federal capital gains tax entirely through the step-up in basis mechanism. This is why many estate planning strategies recommend against gifting highly appreciated assets during life and instead holding them until death to utilize the step-up. Note: the gift recipient takes the donor’s original basis (carryover basis), while the heir at death receives the stepped-up basis. For assets expected to appreciate significantly, holding until death is typically more tax-efficient than gifting to heirs.
Capital Gains Tax Planning Checklist
Frequently Asked Questions: Capital Gains Tax Calculator 2025
What are the 2025 long-term capital gains tax rates?+
2025 LTCG rates for single filers: 0% on taxable income up to $48,350. 15% on $48,351-$533,400. 20% above $533,400. For MFJ: 0% up to $96,700; 15% to $600,050; 20% above. These thresholds use total taxable income (ordinary + LTCG) with the stacking rule. NIIT adds 3.8% for MAGI above $200K (single) or $250K (MFJ). Maximum combined federal LTCG rate: 20% + 3.8% = 23.8%. STCG (held 12 months or less): taxed as ordinary income at marginal bracket rate (10%-37%). Maximum federal STCG: 37% + 3.8% NIIT = 40.8%. Holding assets longer than 12 months saves between 0% and 17 percentage points in federal capital gains tax depending on income level.
What is the difference between short-term and long-term capital gains?+
Short-term (STCG): held 12 months or less. Taxed as ordinary income (10%-37%). Long-term (LTCG): held more than 12 months. Taxed at preferential 0%/15%/20% rates. The 12-month threshold is measured from the trade date of the purchase to the trade date of the sale. Selling one day before the 12-month anniversary: STCG. Selling the day after or later: LTCG. Example: purchased June 15, 2024. Last day for STCG: June 14, 2025. First day for LTCG: June 15, 2025. Tax savings on $50,000 gain (22% bracket): STCG $11,000 vs LTCG $7,500 = $3,500 savings for waiting. The holding period applies to the specific lot, not an average of all purchases.
What is the 3.8% Net Investment Income Tax (NIIT)?+
3.8% surtax on net investment income for taxpayers above MAGI thresholds: $200,000 (single), $250,000 (MFJ). Applies to: capital gains, dividends, taxable interest, rental income, royalties, and passive business income. NOT income from active business participation or Social Security. NIIT = 3.8% x min(Net Investment Income, MAGI – Threshold). Example: single, MAGI $250,000, $60,000 LTCG: NIIT = 3.8% x min($60K, $50K) = 3.8% x $50K = $1,900. The NIIT threshold is NOT inflation-adjusted — it was $200,000/$250,000 in 2013 and remains the same in 2025, meaning an increasing portion of taxpayers are subject to it. Combined LTCG + NIIT maximum: 20% + 3.8% = 23.8% federal on long-term gains for high earners.
How is the long-term capital gains tax rate determined?+
Stacking rule: LTCG is placed on top of ordinary income to determine the applicable rate. Step 1: Calculate ordinary taxable income. Step 2: Add LTCG to get total taxable income. Step 3: Find which LTCG bracket total taxable income falls in. Example: $40,000 ordinary taxable income + $20,000 LTCG = $60,000 total. The LTCG is split: $8,350 fills the 0% space ($48,350 – $40,000 = $8,350); remaining $11,650 is at 15%. LTCG tax = $0 + $11,650 x 15% = $1,748. If ordinary income alone already exceeds $48,350: all LTCG is at 15% (or 20% if total exceeds $533,400). The 0% LTCG rate is only available when ordinary income is below the $48,350 zero-rate threshold.
What is the home sale capital gains exclusion?+
Section 121 exclusion: $250,000 (single) / $500,000 (MFJ) of home sale gains are excluded from taxable income. Requirements: owned AND used as primary residence for at least 2 of the 5 years before sale. Lookback: not used for another sale in past 2 years. Example: MFJ, purchased at $300K, sold at $700K. Gain = $400K. Exclusion = $500K. Taxable gain = $0. Tax = $0. Same sale for single: $400K – $250K = $150K taxable gain x 15% LTCG = $22,500. Planning: the 2-of-5-year window allows significant rental use (up to 3 years) before sale while still qualifying. After 2008, periods of non-primary use (rental) reduce the exclusion proportionally. Partial exclusion available for qualifying job change, health reasons, or unforeseen circumstances. Exclusion resets after 2 years for use on another property.
What is tax-loss harvesting?+
Tax-loss harvesting: selling investments at a loss to offset capital gains (dollar-for-dollar) and up to $3,000/year of ordinary income. Losses carry forward indefinitely. Wash-sale rule: cannot buy the same or substantially identical security within 30 days before or after the sale. To maintain market exposure: buy a similar but not identical security (e.g., sell Vanguard S&P 500 ETF, buy Fidelity S&P 500 ETF — different issuers of similar exposure). After 30 days, repurchase the original if desired. The new basis is the purchased price, potentially at a loss. Tax savings: at 15% LTCG rate, $10,000 in losses saves $1,500. At 23.8% (20% + NIIT): saves $2,380. Key rule: short-term losses offset short-term gains first (at ordinary rates), then long-term gains. Long-term losses offset long-term gains first (at preferential rates), then short-term gains. This ordering matters when deciding which lots to harvest.
What is step-up in basis at death?+
At death, inherited assets receive a “step-up” in cost basis to the fair market value on the date of death (or the alternative valuation date, 6 months later). Example: stock purchased for $10,000 (basis), worth $500,000 at death. Heir inherits: new basis = $500,000. If heir sells immediately: gain = $500,000 – $500,000 = $0. Zero capital gains tax on $490,000 of appreciation. This is one of the most valuable estate planning provisions in US tax law. Planning implications: holding appreciated assets until death (rather than gifting them) passes the assets to heirs with no capital gains tax on accumulated appreciation. Gifting during life: recipient takes donor’s carryover basis ($10,000), eventually paying capital gains on the full $490,000 gain. Only assets included in the taxable estate receive the step-up — assets in IRAs and 401(k)s do NOT receive a step-up (they are IRD — Income in Respect of a Decedent — and are taxed as ordinary income when distributed to the heir).
How are capital gains taxed in California?+
California taxes ALL capital gains (short and long-term) as ordinary income — there is no preferential LTCG rate at the state level. California marginal rates go up to 13.3%. Combined federal + California rate on long-term gains for a high earner: 23.8% federal + 13.3% California = 37.1% combined rate on LTCG. On short-term: 40.8% federal + 13.3% California = 54.1% combined rate on STCG. This makes California one of the highest capital gains tax jurisdictions in the developed world. For comparison: a high-income Texas investor pays only 23.8% federal on the same long-term gain. The 13.3% California state tax on capital gains is a primary driver of tax-motivated relocations from California to Nevada, Texas, and Florida for investors planning major asset sales (business sales, large stock positions).
What happens to capital gains when you die and leave assets in an IRA?+
Traditional IRA assets do NOT receive a step-up in basis at death. IRA assets are pre-tax, so they are “Income in Respect of a Decedent” (IRD). When an heir inherits a traditional IRA, all distributions are taxed as ordinary income (not capital gains) at the heir’s marginal tax rate. Example: $500,000 traditional IRA inherited by heir in the 22% bracket. As heir takes distributions, each dollar is taxed at 22% (or higher, depending on the heir’s total income). The $490,000 in growth within the IRA does not receive a capital gains preference — it’s all ordinary income. SECURE Act 2.0: most non-spouse beneficiaries must empty an inherited IRA within 10 years (the “10-year rule”). This forces acceleration of taxable distributions, potentially at high rates if the heir has other income. Roth IRA assets also do NOT receive a step-up in basis, but qualified Roth distributions are tax-free (the heir receives the Roth’s full value without income tax). This is why estate planners often recommend holding taxable appreciated assets (stocks) until death for the step-up, while converting traditional IRA assets to Roth during life to avoid the inherited IRA ordinary income burden.
Key Takeaways
Capital gains tax has three distinct rate tiers based on holding period and income: short-term gains (12 months or less) are taxed at ordinary income rates (10%-37%), long-term gains (more than 12 months) are taxed at preferential rates of 0%, 15%, or 20% based on total taxable income, and the 3.8% NIIT adds on top for high earners with MAGI above $200,000 (single) or $250,000 (MFJ). A single filer with $120,000 in ordinary income pays $7,500 in federal tax on a $50,000 LTCG (15% rate) versus $12,000 if the same gain were short-term (24% ordinary rate) — a $4,500 savings from waiting past the 12-month holding threshold. Maximum combined federal capital gains rates: LTCG 23.8% (20% + NIIT), STCG 40.8% (37% + NIIT).
Three highest-value capital gains planning strategies: realize long-term gains in the 0% bracket during low-income years (the entire gain costs zero federal tax for taxable income below $48,350), donate appreciated long-term assets directly to charity rather than selling and donating cash (eliminates capital gains tax entirely while generating a full fair-market-value charitable deduction), and hold appreciated assets until death to pass them to heirs with a full step-up in basis (eliminating capital gains tax on all lifetime appreciation accumulated in taxable accounts).
Calculate Your Capital Gains Tax: STCG vs LTCG, NIIT, and Total Federal Tax
Our Capital Gains Tax Calculator determines the applicable LTCG rate using the stacking rule, calculates NIIT if your income exceeds the threshold, compares short-term versus long-term treatment, shows the 0% gain harvesting opportunity, and models the Section 121 home sale exclusion for primary residence sales. For related analysis, see our 1031 exchange tax deferral calculator.
Launch the Capital Gains Calculator