Capital Gains Tax Calculator
Calculate taxes on investment gains
How It Works
Overview
A capital gains tax calculator estimates the federal tax you owe when you sell an investment for more than you paid for it. The two big inputs are your holding period (which determines whether the gain is short-term or long-term) and your taxable income (which sets the bracket the gain lands in). The difference between the two regimes is enormous — a single high earner could pay 37% on a short-term gain or 20% on the same gain held over a year.
Long-term capital gains rates of 0%, 15%, and 20% are among the most generous tax breaks in the US code, designed to encourage long-term investing. Layered on top is the 3.8% Net Investment Income Tax for higher-income filers, plus state income tax (up to 13.3% in California). The result: actual all-in tax can range from 0% to over 37% depending on where you live and how long you held.
The Formula
Where:
- Sale Price = net proceeds from selling the asset (after commissions)
- Cost Basis = original purchase price plus any reinvested dividends or capital improvements
- Applicable Rate = ordinary income bracket (10–37%) for short-term, or 0/15/20% for long-term, based on taxable income tier
Long-term thresholds for 2024 (single): 0% up to $44,625 of taxable income, 15% from $44,626 to $518,900, and 20% above that. For married filing jointly: 0% up to $89,250, 15% to $583,750, then 20%. The gain itself is included in the income that determines the bracket.
Worked Example
Suppose you bought $20,000 of an index fund and sold it three years later for $35,000. You're a single filer with $90,000 of other taxable income:
- Capital gain: $35,000 − $20,000 = $15,000
- Holding period: 3 years → long-term
- Total taxable income with gain: $105,000 — places gain in the 15% long-term bracket
- Federal capital gains tax: $15,000 × 15% = $2,250
- Net after-tax gain: $12,750
If you had instead sold after 11 months, that same $15,000 would be a short-term gain taxed at your 24% marginal ordinary rate, costing $3,600 — a $1,350 penalty for selling 30 days early. Add 3.8% NIIT and 5% state tax in many cases, and short-term selling can cost 30%+ all-in.
When to Use This
- Year-end tax planning — decide whether to realize gains in December or wait until January.
- Choosing what to sell — compare two lots with different cost bases and holding periods to minimize the tax bill.
- Tax-loss harvesting — pair gains with losses to net out exposure within the year.
- Real estate sales — estimate tax owed on a rental property or a primary home gain above the $250K/$500K Section 121 exclusion.
- Roth conversions — model how a planned gain plus a Roth conversion shift your bracket and the resulting tax on each.
Common Mistakes to Avoid
- Selling at month 11. Holding to day 366 changes the rate from up to 37% to a maximum of 20% — sometimes worth thousands.
- Forgetting state tax. California taxes capital gains as ordinary income at up to 13.3%; New York up to 10.9%. Federal-only estimates can understate liability significantly.
- Ignoring the 3.8% NIIT. For high-income filers it pushes the effective long-term rate to 23.8% federal.
- Wash sales. Selling at a loss and buying back the same security within 30 days disallows the loss, eliminating the tax benefit.
- Wrong cost basis. If you reinvested dividends, your cost basis is higher than your original purchase — using the original number alone overstates gain and tax.
- Stacking gains in one year. Spreading large sales across two tax years can keep you in lower brackets and below NIIT or 20% thresholds.
Frequently Asked Questions
Smart Suggestions
Related calculators you might find useful
Ad Space