Capital Gains Tax Calculator

Estimate the federal tax on your profit from selling stocks, crypto, real estate or other investments.

$
$
$
$
After deductions, excluding this gain
%
Used for short-term gains
%

2026 Long-Term Rates

RateSingleMarried joint
0%up to $49,450up to $98,900
15%up to $545,500up to $613,700
20%aboveabove

Thresholds are taxable income including the gain. Confirm current figures with the IRS before filing.

How capital gains tax is calculated

Capital gain = Sale price − Cost basis − Selling costs
Tax = Gain × Applicable rate (+ 3.8% NIIT if it applies) + State tax

Cost basis is what you paid, plus purchase fees and, for property, the cost of improvements.

Short-term vs. long-term gains

Assets held for one year or less produce short-term gains, taxed at your ordinary income tax rate. Assets held for more than one year produce long-term gains, taxed at 0%, 15% or 20% depending on your taxable income. Holding an investment just past the one-year mark can make a large difference.

Example

A single filer with $80,000 of other taxable income sells shares bought for $20,000 for $35,000 — a $15,000 gain. Held long-term, the whole gain falls in the 15% bracket and the federal tax is $2,250. Held short-term in the 22% bracket, the tax would be about $3,300.

How the 0% / 15% / 20% brackets work

Long-term gains are stacked on top of your other taxable income. If your other income is below the 0% threshold, the part of the gain that fits under the threshold is taxed at 0% and only the remainder at 15%. This calculator applies that stacking automatically.

The 3.8% net investment income tax

An additional 3.8% applies to investment income when modified adjusted gross income exceeds $200,000 (single or head of household) or $250,000 (married filing jointly). It is charged on the smaller of your net investment income or the amount over the threshold.

Ways to reduce capital gains tax

  • Hold for more than a year to qualify for long-term rates.
  • Offset gains with losses (tax-loss harvesting); up to $3,000 of excess losses can offset ordinary income each year.
  • Sell in a year when your income is lower.
  • Use tax-advantaged accounts such as IRAs, 401(k)s and HSAs.
  • When selling your main home, check the exclusion of up to $250,000 of gain ($500,000 for married couples) if you owned and lived in it for two of the last five years.

This estimate covers federal tax on a single sale and does not handle special cases such as collectibles (28% maximum), depreciation recapture on real estate or the alternative minimum tax. It is not tax advice.

FAQs

Long-term gains are taxed at 0%, 15% or 20% depending on taxable income. For 2026 the 15% rate begins above $49,450 for single filers and $98,900 for married couples filing jointly. Short-term gains are taxed at ordinary income rates.

Subtract your cost basis (purchase price plus commissions) from the sale proceeds. Multiply the gain by your long-term rate if you held the shares for more than a year, or by your ordinary income rate if you held them for a year or less.

Often not. If it was your main home and you owned and lived in it for at least two of the last five years, you can exclude up to $250,000 of gain, or $500,000 if married filing jointly.

Most states tax capital gains as ordinary income. A few states have no income tax, and some apply special rates, so enter your state rate for a fuller estimate.