🇺🇸 Built for Americans. 100% Free. No Sign-Up Required.
📊 220+ Free Finance Calculators
📝 220+ In-Depth Blog Guides
All Tools Live & Free
2025 Capital Gains Tax Rates and Thresholds

Capital Gains Tax Calculator:
Short-Term vs Long-Term Rates, NIIT 3.8%, and Net Tax Owed on Investment Sales

14-Minute Read Tax Year 2025 For Individual Investors, Business Owners, and Retirees

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.

LTCG: 0% / 15% / 20% STCG: Ordinary Income Rate NIIT: 3.8% Above $200K AGI LTCG Stacking Rule Hold 12+ Months for LTCG $250K/$500K Home Exclusion Step-Up in Basis at Death Tax-Loss Harvesting

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

Capital Gains Tax Calculation Formulas

1. REALIZED CAPITAL GAIN

Capital Gain = Sale Proceeds Adjusted Basis (Cost + Improvements – Depreciation)

2. LTCG RATE (STACKING RULE — GAIN ON TOP OF ORDINARY INCOME)

LTCG Tax = LTCG Amount × Rate (0% / 15% / 20%) based on total taxable income

3. NET INVESTMENT INCOME TAX (NIIT)

NIIT = 3.8% × MIN(Net Investment Income, MAGI – Threshold)

4. TOTAL FEDERAL TAX ON SALE

Total Tax = Ordinary Income Tax + LTCG Tax (or STCG at ordinary rate) + NIIT (if above threshold)
Realized gain ($50,000 LTCG example): Purchased stock for $70,000 (adjusted basis), sold for $120,000. Gain = $120,000 – $70,000 = $50,000 LTCG (held 14 months = long-term). Basis = original cost; adjustments for dividends reinvested, stock splits, or improvements if real estate.
LTCG rate on $50,000 gain ($120K ordinary income single filer): Ordinary taxable income = $105,000 (above $48,350 zero threshold). ALL $50,000 LTCG taxed at 15%. LTCG tax = $50,000 x 15% = $7,500. No 0% applies because ordinary income already exceeded $48,350.
NIIT ($250K MAGI single, $60K net investment income): NIIT = 3.8% x MIN($60,000, $250,000-$200,000) = 3.8% x $50,000 = $1,900. NIIT threshold ($200K single) is NOT inflation-adjusted — it grows more common each year.
Maximum combined federal LTCG rate: 20% LTCG + 3.8% NIIT = 23.8% federal. Most states also tax LTCG at ordinary income rates (California: 9.3% adds to = 33.1% combined). STCG at 37% + 3.8% NIIT = 40.8% federal maximum for high earners.

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

0% LTCG Rate (Income Management)
Ordinary taxable income$30,000
0% LTCG threshold (single 2025)$48,350
Available 0% space$18,350
LTCG realized (harvest at 0%)$18,350
LTCG tax at 0%$0 !
Same gain if short-term (22%)$4,037
Reset basis after tax-free harvestTax-free step-up
Ideal for: retirees, low-income yearsUnderutilized!
15% LTCG: $50K Gain on $120K Income
Ordinary taxable income$105,000
LTCG amount (held 14 months)$50,000
Total taxable income$155,000
LTCG rate (15% zone)15%
LTCG federal tax$7,500
If short-term gain at 24%$12,000
Savings from long-term hold$4,500 saved
NIIT? (AGI $170K, below $200K)No NIIT
NIIT Impact: $60K Gain on $250K Income
Ordinary income + LTCG$310,000 total
MAGI above $200K threshold$110,000 excess
Net investment income (LTCG)$60,000
NIIT base = MIN($60K, $110K)$60,000
NIIT = 3.8% x $60,000$2,280
LTCG tax at 15%: $60K x 15%$9,000
Total on LTCG (15% + 3.8%)$11,280 (18.8%)
STCG alternative (32% + 3.8%)$21,480 (35.8%)
Home Sale: $400K Gain, $500K Exclusion (MFJ)
Home purchased at basis$300,000
Home sold$700,000
Capital gain$400,000
Section 121 exclusion (MFJ)-$500,000
Taxable gain (fully excluded!)$0
Tax owed on home sale$0
Single filer same sale$22,500 tax ($150K taxable)
Requirement: 2 of last 5 yearsOwn and use test

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 Calculator

Complete Capital Gains Tax Calculation: $50,000 LTCG on $120,000 Income

Capital Gains Tax: $120K Ordinary Income | $50K LTCG | Single | 2025 | No NIIT (AGI Below $200K)
Gross ordinary income (W-2)$120,000
Standard deduction (single, 2025)-$15,000
Ordinary taxable income$105,000
Ordinary income tax: 10%+12%+22%+24% on $105,000$18,047
Long-term capital gain (stock held 14 months)$50,000
Total taxable income ($105K + $50K): in 15% LTCG zone$155,000
LTCG tax: $50,000 x 15% (all above $48,350 threshold)$7,500
NIIT check: AGI $170K below $200K threshold$0 NIIT
Short-term alternative: $50,000 x 24% (ordinary rate at $105K)$12,000 (STCG)
Tax savings from long-term hold: $12,000 – $7,500$4,500 saved
Total federal tax (ordinary + LTCG + NIIT) | Effective rate on $170K AGI$25,547 | 15.0%

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 RateSingleMarried Filing JointlyHead of HouseholdMarried 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,400Above $600,050Above $566,700Above $300,000
NIIT (additional 3.8%)MAGI above $200,000MAGI above $250,000MAGI above $200,000MAGI 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 IncomeSTCG Tax (at ordinary rate)LTCG Tax (at preferred rate)NIIT (3.8%)LTCG + NIIT TotalTax 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

Scenario Federal tax on $50,000 capital gain. Scale: $20,400 max (top STCG). Long-term holding saves $4,500-$10,940 in federal tax on same $50K gain depending on income level. Tax
LTCG, low income (0%)
$0 — at or below $48,350 taxable income
$0
LTCG, mid income (15%)
$7,500 — 15% LTCG rate, no NIIT
$7,500
LTCG + NIIT (15%+3.8%)
$9,400 — at $210K income (above NIIT threshold)
$9,400
LTCG + NIIT (20%+3.8%)
$11,900 — above $533,400 income
$11,900
STCG at 22% bracket
$11,000 — taxed as ordinary income
$11,000
STCG at 37% + NIIT
$20,400 — top bracket short-term (37%+3.8%)
$20,400

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

Track Every Asset’s Holding Period and Cost Basis Before SellingThe holding period determination — short-term (12 months or less) versus long-term (more than 12 months) — is the most consequential variable in capital gains tax, potentially costing thousands in unnecessary tax if missed. Track purchase dates, reinvested dividends (which increase basis), stock splits (which adjust per-share basis), and return-of-capital distributions (which reduce basis). For positions with partial purchases over time, specific identification allows you to choose which lot to sell (highest basis first to minimize current gain, lowest basis for tax-loss harvesting). Default method without specific identification: FIFO (first in, first out) for taxable accounts. Confirm your broker’s default cost basis method and change it if needed before placing the sell order — basis elections typically cannot be changed after the trade settles.
Harvest Capital Losses Before Year-End to Offset Gains Dollar-for-DollarCapital losses offset capital gains dollar-for-dollar: short-term losses offset short-term gains first, then long-term gains; long-term losses offset long-term gains first, then short-term gains. Net capital losses up to $3,000 per year offset ordinary income; excess losses carry forward indefinitely. Tax-loss harvesting strategy: sell underperforming positions in December to realize losses that offset gains recognized earlier in the year. Wash-sale rule: you cannot repurchase the same (or substantially identical) security within 30 days before or after the sale and still claim the loss. To maintain market exposure while harvesting the loss, purchase a similar but not substantially identical alternative (e.g., sell S&P 500 ETF, buy Total Market ETF) for the 30-day window. At 15% LTCG rate, $10,000 in harvested losses that offset gains saves $1,500 in current-year tax. At 23.8% (20% + NIIT), the same $10,000 saves $2,380.
Evaluate Gain Harvesting at the 0% Rate During Low-Income YearsDuring years when your total taxable income is below the 0% LTCG threshold ($48,350 single / $96,700 MFJ), long-term capital gains up to the threshold are completely tax-free federally. This creates a zero-cost opportunity to: sell appreciated positions and reset the basis at the current value (reducing future gains), rebalance the portfolio without tax friction, accelerate recognition of gains that would otherwise be taxed in a higher-rate year, or convert appreciated taxable investments to cash for spending needs. Common low-income situations for gain harvesting: year of retirement before Social Security begins, sabbatical or career break year, year of large deductible business losses, or early retirement years before Required Minimum Distributions begin. Planning the timing of income and gains can allow thousands of dollars in tax-free gain recognition — but only in years where ordinary income is sufficiently low to create space below the 0% threshold.
Account for State Capital Gains Taxes in Total Rate CalculationMost states tax capital gains as ordinary income at the same rate as wages, with no preferential rate for long-term gains. This means the federal LTCG rate advantage is partially offset by the state tax burden. California, the highest, taxes capital gains at ordinary income rates up to 13.3% — combined with the 23.8% federal maximum LTCG rate, a California investor in the highest bracket faces a 37.1% combined rate on long-term gains. In Texas, the combined rate is just 23.8% (no state tax). For large transactions (business sales, real estate sales), the state capital gains tax can be material enough to warrant state residency planning: selling a $2,000,000 business interest generates approximately $266,000 in California state capital gains tax (13.3%) that would not exist in Texas. Changing domicile to a no-tax state before completing a major asset sale is a legitimate tax planning strategy but requires careful attention to state residency rules and timing.
Consider Qualified Opportunity Zone (QOZ) Investments to Defer and Reduce Capital GainsQualified Opportunity Zone (QOZ) investments allow taxpayers to defer and potentially reduce capital gains taxes by reinvesting realized gains into a Qualified Opportunity Fund (QOF) within 180 days of the sale. Under current rules post-2021: deferral of the original gain until December 31, 2026 (or earlier sale of the QOF investment). Gain exclusion: 0% federal tax on appreciation in the QOF investment itself after a 10-year hold period. The 10-year exclusion remains available even after 2026 as long as the QOF investment was made during the original opportunity zone period and is held to 10 years. QOZ investments are most valuable for large capital gains (above $250,000) where the deferral interest savings and 10-year exclusion provide meaningful tax value. QOZ investments also carry investment risk — the underlying real estate or business must generate returns that justify the illiquidity and complexity premium over a standard investment.
Use Charitable Giving to Eliminate Capital Gains Tax on Appreciated AssetsDonating appreciated long-term capital assets directly to a charity (or to a donor-advised fund) avoids the capital gains tax entirely and generates a charitable deduction for the full fair market value. This is significantly more tax-efficient than selling the asset and donating the cash proceeds. Example: $50,000 stock position with $5,000 basis ($45,000 LTCG). Option A: sell, pay 15% LTCG tax ($6,750), donate $43,250 cash. Net charitable deduction: $43,250. Option B: donate stock directly to charity. Charitable deduction: $50,000. Capital gains tax: $0. Net benefit of direct donation vs sell-and-donate: $50,000 deduction (vs $43,250) + $6,750 capital gains tax saved = $13,500 more value in Option B. Donor-advised funds (DAFs) accept direct donations of appreciated securities and allow the donor to recommend grants to charities over time — providing both the immediate tax benefit of the donation and the flexibility to distribute to charities on your own schedule.
Understand That the NIIT Applies to NET Investment Income, Not GrossThe 3.8% NIIT applies to NET investment income — after investment-related expenses and losses. Investment expenses that reduce the NIIT base include: investment advisory fees (deductible against investment income for NIIT, though no longer deductible on Schedule A for regular income tax), rental property depreciation and operating expenses (reduce rental income subject to NIIT), and capital losses (net against gains before applying NIIT). For investors with significant investment-related expenses, the NIIT base may be meaningfully lower than gross investment income, reducing the NIIT liability. Additionally, the NIIT applies to passive activity income (rental income, partnership income where the taxpayer is passive) but NOT to active business income where the taxpayer materially participates. Rental income from rental activities in which the taxpayer qualifies as a real estate professional is also exempt from NIIT.

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
Written, Researched & Reviewed by
David — Finance Expert & Founder, USFinanceCalculators.com ✦ Verified Author LinkedIn
Finance Expert & Founder
David
Founder · USFinanceCalculators.com  |  Lab & CS Manager · Coats
🎯 Specializing in: US Mortgage Math · Business Valuation · Tax & Investment Tools

David is a finance professional, web developer, and the founder of USFinanceCalculators.com — a platform offering 200+ free financial calculators for US consumers and businesses. He holds an MBA in Finance from UET Lahore and an MSc from the University of Karachi, bringing nearly 20 years of experience across financial analysis, data systems, and operations.

In his professional career, David serves as Lab & CS Manager at Coats, a global leader in industrial thread manufacturing. His real-world background in finance and technology drives the accuracy behind every calculator and article on this site. Publishing free financial tools since 2018.

🎓 MBA Finance — UET Lahore 🎓 MSc — University of Karachi 🏭 Manager · Coats 🧮 200+ Calculators Built 📅 Publishing Since 2018