Estimate Your Long-Term Capital Gains Tax
Enter your numbers below to estimate federal long-term capital gains tax, potential NIIT (3.8%), and optional state tax.
What this long-term capital gains calculator does
This calculator helps you estimate taxes on an investment sale by comparing your adjusted cost basis with your net sale proceeds. If your holding period is at least 12 months, it applies long-term capital gains brackets (0%, 15%, 20%) and optionally estimates Net Investment Income Tax (NIIT) and state tax.
If your holding period is under 12 months, the tool flags the sale as short-term and uses your estimated ordinary tax rate for a rough comparison. This gives you a fast way to check whether waiting to cross the one-year mark could lower your tax bill.
How long-term capital gains are calculated
1) Compute your adjusted basis
Your adjusted basis generally starts with what you paid for the asset and then adds qualifying costs, such as:
- Purchase closing costs and fees
- Capital improvements that increase value or useful life
- Other basis adjustments allowed by tax rules
2) Compute amount realized
Your amount realized is usually your sale price minus selling costs (brokerage commission, legal fees, transfer costs, and similar items).
3) Gain or loss
Capital gain (or loss) = Amount realized - Adjusted basis. A positive number is a gain; a negative number is a loss.
4) Apply tax rates by holding period
- 12 months or more: long-term capital gains rates apply (0%, 15%, 20% based on taxable income and filing status).
- Less than 12 months: short-term gains are typically taxed at ordinary income rates.
Why taxable income matters for capital gains
Long-term capital gains are not taxed at one flat rate for everyone. The rate depends on where your total taxable income lands. In practice, different parts of a gain can be taxed at different rates. For example, a portion may fall in the 0% band and the rest in the 15% band.
That is why this tool asks for taxable income excluding the gain. It can then estimate how much of your gain lands in each federal capital gains bracket.
Common planning ideas to reduce long-term capital gains tax
- Hold assets longer: crossing the 12-month threshold can shift gains from ordinary rates to lower long-term rates.
- Tax-loss harvesting: realized losses can offset realized gains.
- Spread sales across years: avoid pushing too much gain into higher brackets in one tax year.
- Use tax-advantaged accounts: retirement accounts can defer or avoid current-year capital gains taxes.
- Donate appreciated assets: in many cases you may avoid capital gains and still claim a charitable deduction.
Important assumptions and limitations
This calculator is an estimate tool and does not replace tax advice. Real returns can include details this page does not model, such as depreciation recapture, collectible rates, Qualified Small Business Stock rules, installment sales, special state rules, primary residence exclusions, wash-sale effects, and AMT interactions.
Always confirm final numbers with current IRS guidance and a qualified CPA or tax attorney before filing.
Quick FAQ
Is this calculator only for stocks?
No. The same high-level gain framework can apply to many capital assets (stocks, funds, real estate investments, business interests), though asset-specific rules may differ.
What if I have a capital loss?
The calculator will show a loss and no capital gains tax due on that transaction. Tax treatment of losses against other gains or ordinary income depends on your full return.
Does this include state taxes?
Yes, as a simple percentage input. Since state rules vary widely, treat that figure as a rough estimate unless you use your exact state methodology.