What This Calculator Does
Selling an investment for a profit triggers capital gains tax. The amount you owe depends on how long you held the asset, your taxable income, and your filing status. This calculator estimates your federal capital gains tax using 2026 IRS brackets for both long-term gains (assets held more than one year) and short-term gains (held one year or less). It also factors in the 3.8% Net Investment Income Tax for high earners.
The difference between long-term and short-term rates is stark. Short-term gains are taxed as ordinary income at rates from 10% to 37%. Long-term gains use a separate, lower bracket structure with rates of 0%, 15%, and 20%. For someone in the 24% ordinary bracket, holding an asset just one extra day to cross the one-year threshold can cut the tax rate on gains from 24% to 15%. That is a 9 percentage point difference on potentially thousands of dollars.
If you are also managing salary deferrals or retirement contributions to lower your taxable income, our Income Tax Calculator shows how ordinary income brackets interact. For investment growth projections before a sale, our Investment Calculator can model future values.
Inputs Required
- Capital Gains Amount: The profit from selling your investment (sale price minus cost basis)
- Other Taxable Income: Your ordinary income from wages, interest, dividends, etc. This determines which capital gains bracket you fall into
- Holding Period: Long-term (more than one year) or short-term (one year or less)
- Filing Status: Single, Married Filing Jointly, or Head of Household
Outputs Provided
- Total Capital Gains Tax: Federal tax owed on your investment gains
- Marginal Rate: The highest rate applied to your gains
- Effective Rate: Total tax divided by total gains
- Net Investment Income Tax: The 3.8% NIIT surcharge, if applicable
- After-Tax Gains: Your profit after federal taxes
- Bracket Breakdown: Line-by-line view of how each rate applies
How the Calculation Works
Long-term capital gains use a stacked bracket system. Your ordinary income fills the lower brackets first, and then capital gains are taxed at the rates corresponding to the income level where they land. This is why your ordinary income matters even though the gains are taxed at separate rates.
Tax on LT Gains = Sum of (rate x gains in each bracket)
Brackets are determined by: Ordinary Income + Capital Gains
For 2026, the long-term capital gains brackets are:
2026 Long-Term Capital Gains Rates:
0%: Single $0-$49,450 / MFJ $0-$98,900 / HoH $0-$66,200
15%: Single $49,451-$545,500 / MFJ $98,901-$613,700 / HoH $66,201-$579,600
20%: Single $545,501+ / MFJ $613,701+ / HoH $579,601+
Short-term gains are simpler. They are added to your ordinary income and taxed at the regular 10% to 37% progressive rates, the same as wages. The calculator applies the marginal rate to the gains portion, which is the correct approach since the gains sit on top of your existing income.
The Net Investment Income Tax (NIIT) adds 3.8% on investment income for taxpayers with modified adjusted gross income above $200,000 (single or HoH) or $250,000 (married filing jointly). This brings the top combined federal rate on long-term capital gains to 23.8%.
How to Use the Calculator
- Enter the total capital gains amount (sale price minus your original purchase price, including any reinvested dividends)
- Enter your other taxable income for the year, including wages, interest, and ordinary dividends
- Select whether you held the asset for more than one year (long-term) or one year or less (short-term)
- Choose your filing status
- For long-term gains, decide whether to include the 3.8% NIIT (check the box if your total income exceeds the thresholds)
- Review the bracket breakdown to see exactly which rates apply to your gains
Example Calculations
Example 1: Single Filer Selling Stock After 2 Years
Maria, a single filer in Texas, earns $75,000 in wages and sells $50,000 in stock she held for two years. Her total taxable income including gains is $125,000.
- Ordinary income: $75,000 (fills the 0% bracket up to $49,450)
- Gains in 0% bracket: $0 (her ordinary income already exceeds $49,450)
- Gains in 15% bracket: $50,000 (all gains fall in the 15% bracket)
- Tax on gains: $7,500 (15% of $50,000)
- NIIT: $0 (total income $125,000 is below $200,000 threshold)
- After-tax gains: $42,500
Example 2: Married Couple Selling a Rental Property
David and Lisa, married filing jointly, have $180,000 in ordinary income. They sell a rental property for a $200,000 long-term capital gain. Their total taxable income is $380,000.
- Ordinary income: $180,000 (fills the 0% bracket up to $98,900)
- Gains in 0% bracket: $0 (ordinary income exceeds $98,900)
- Gains in 15% bracket: $200,000 (all gains fall in 15% bracket, below $613,700)
- Tax on gains: $30,000 (15% of $200,000)
- NIIT: $4,940 (3.8% on $130,000, the amount total income exceeds $250,000)
- Total tax: $34,940
- After-tax gains: $165,060
If they had sold the property after holding it for only 10 months, the $200,000 would be taxed as ordinary income. At their 24% marginal rate, the tax would be approximately $48,000 instead of $34,940. The holding period saved them over $13,000.
Real World Scenarios
Timing a Stock Sale Around the One-Year Mark
James bought 500 shares of a tech company at $40 per share. The stock is now at $100, giving him a $30,000 gain. He wants to sell in late December 2026, which would be 11 months and 20 days after purchase. If he sells now, the $30,000 is short-term and taxed at his 22% ordinary rate, costing $6,600. If he waits 11 more days to cross the one-year mark in January 2027, the gain becomes long-term and taxed at 15%, costing $4,500. The 11-day wait saves $2,100. But he also carries the risk that the stock drops in those 11 days. If the stock falls by more than $2,100 in value (a 4.2% decline on $30,000), waiting is not worth it.
Harvesting Gains in the 0% Bracket
A retired couple filing jointly has $60,000 in Social Security and pension income. Their taxable income is $40,000 after deductions. The 0% long-term capital gains bracket covers up to $98,900 for married filing jointly. They can realize up to $58,900 in long-term gains and pay $0 federal tax on those gains. This is a powerful strategy for retirees in low-income years to rebalance portfolios without triggering tax. They could sell appreciated stock, take the gains tax-free, and immediately rebuy the same stock to reset their cost basis higher.
Managing the NIIT Threshold
A single filer earns $195,000 in wages and is considering selling $100,000 in long-term gains. Total income would be $295,000, which is $95,000 above the $200,000 NIIT threshold. The NIIT adds $3,610 (3.8% of $95,000). If she can defer $5,000 of the gain to the following tax year by spreading the sale across two calendar years, her total income stays at $290,000. The NIIT drops to $3,420, saving $190. More importantly, if she expects lower income next year, deferring more gains could keep her under the threshold entirely.
Common Mistakes to Avoid
- Not tracking cost basis accurately: Reinvested dividends increase your cost basis. If you do not account for them, you will overstate your gain and overpay tax. Brokerages are required to track this for shares purchased after 2011, but older holdings may need manual records
- Forgetting about state capital gains taxes: Most states tax capital gains as ordinary income. California adds up to 13.3% on top of the federal rate. This calculator covers federal tax only
- Ignoring the NIIT: High earners often forget the 3.8% surcharge. At $250,000 of total income for a single filer, the NIIT adds $1,900 on a $50,000 gain. That is a 3.8% increase in your effective rate
- Selling too early: Selling one day before the one-year mark turns a 15% long-term gain into a 22% or 24% short-term gain. On a $50,000 gain, that is $3,500 to $4,500 in extra tax for being one day impatient
Limitations of This Calculator
This calculator estimates federal capital gains tax only. It does not account for state or local taxes, which can add up to 13% or more depending on where you live. It does not handle special cases such as collectibles (28% max rate), unrecaptured Section 1250 depreciation on real estate (25% max rate), or qualified small business stock exclusions. It does not model tax-loss harvesting, wash sale rules, or capital loss carryforwards. The NIIT calculation is simplified and does not account for modifications to adjusted gross income. For complex situations, consult a licensed tax professional or CPA.
Authoritative Research & Resources
- IRS Topic 409 - Capital Gains and Losses - The official IRS topic page explaining how capital gains are classified as short-term or long-term, how the 0%, 15%, and 20% rates apply, and special rate categories for collectibles and real estate.
- IRS - Tax Year 2026 Inflation Adjustments - The official IRS announcement of 2026 tax year inflation adjustments including capital gains bracket thresholds, published as Revenue Procedure 2025-32.
- IRS - Net Investment Income Tax - The official IRS page detailing the 3.8% NIIT, including income thresholds, what counts as net investment income, and how the tax is calculated.