Capital Gains Calculator
The Tax Bill Depends on How Long You Waited
Selling an investment for more than you paid produces a capital gain — but how that gain is taxed hinges heavily on how long the asset was held. Cross the one-year mark and the gain typically shifts from being taxed at ordinary income rates to the lower long-term capital gains rates, which is why holding period is tracked right alongside the dollar figures.
The Formula
Tax Owed = Capital Gain × (Tax Rate ÷ 100), only if the gain is positive
Net Gain After Tax = Capital Gain − Tax Owed
Holding periods of 12 months or more are classified as long-term; anything shorter is short-term. The calculator doesn't hardcode a tax rate for either classification — you supply the rate that applies to your situation, since it depends on your income bracket and filing status.
Short-Term vs. Long-Term: Why the Rate Structure Differs
- Short-term gains (held under 12 months) are taxed as ordinary income, at the same marginal rates as wages — up to 37% federally.
- Long-term gains (held 12+ months) are taxed at preferential rates — 0%, 15%, or 20% federally, depending on total taxable income.
- Losses can offset gains and, within limits, ordinary income, though the calculator here focuses on the gain-and-tax side of a single position.
Worked Example
An investment purchased for $8,000 and sold for $11,500, held long-term:
| Tax Rate Applied | Tax Owed | Net Gain After Tax |
|---|---|---|
| 0% | $0.00 | $3,500.00 |
| 15% | $525.00 | $2,975.00 |
| 20% | $700.00 | $2,800.00 |
0%, 15%, and 20% are the standard federal long-term capital gains rate tiers; which one applies depends on your total taxable income and filing status for the year.
How to Use This Calculator
- Enter the Purchase Price and Sale Price of the asset.
- Enter the Holding Period in months (used to classify short-term vs. long-term).
- Enter the Capital Gains Tax Rate that applies to your situation.
- Select Calculate to see the gain or loss, classification, tax owed, and net gain after tax.
Related Calculations
Reinvesting dividends from the same position? See the Dividend Calculator, or measure the position's annualized growth with the CAGR Calculator.