Home / US Calculators / Capital Gains Tax

Investing & Tax

Capital Gains Tax Calculator

Estimate the federal tax on an investment sale and see the difference between short-term and long-term treatment, so you know your after-tax profit before you sell.

Estimated capital gains tax

$4,500

Capital gain
Applied rate
If short-term instead
If long-term instead
After-tax profit

Short-term vs long-term tax on this gain

Holding more than a year usually means a lower rate.

Capital gains, defined

A capital gain is the profit when you sell an asset for more than your cost basis (what you paid). The federal tax depends on your holding period: short-term gains (held one year or less) are taxed as ordinary income, while long-term gains (held over a year) get lower rates of 0%, 15% or 20% based on your taxable income.

The formula

capital gain = sale price − cost basis
short-term tax = gain × your ordinary marginal rate
long-term tax = gain × (0%, 15%, or 20% by income)
after-tax profit = gain − tax

Worked example

Buy stock for $20,000, sell for $50,000 → a $30,000 gain. Held long-term with $70,000 of income (single), you're in the 15% bracket: 30,000 × 15% = $4,500. Held short-term, the same gain is taxed at your ordinary rate (22-24%), roughly $6,600-$7,200, the reason holding past a year matters.

Frequently asked questions

What is capital gains tax?

Federal tax on profit from selling an asset above its cost basis.

Short-term vs long-term?

Short-term (≤1 yr) is ordinary income; long-term (>1 yr) gets 0/15/20%.

What are the long-term rates?

0%, 15% or 20% depending on your taxable income and filing status.

How do I lower the tax?

Hold over a year, harvest losses, or use tax-advantaged accounts.

Does this include NIIT or state tax?

No, it's a simplified federal estimate.

Related calculators