Capital Gains Tax Calculator

See what you might owe when you sell an investment for a profit. Enter your cost basis, sale price, other income and holding period, then press Calculate to estimate the federal tax.

Written by TopicDrill Editorial Team·Updated June 2026

Share this calculator

Your sale details

Fill in the numbers, then press Calculate.

$
$
$

Estimated tax owed

$4,500

On a $30,000 gain · 15.0% effective rate

Capital gains tax$4,500
Net investment income tax$0
Net proceeds after tax$45,500

How the gain is taxed

Gain in tier
$0$7.5k$15.0k$22.5k$30.0k$30.0k15% ratetax $4.5k

Advertisement

How the capital gains tax calculator works

The tool starts with your gain, which is the sale price minus the price you originally paid, known as your cost basis. If the result is negative you have a loss and owe no capital gains tax. If it is positive, the way it is taxed depends entirely on how long you held the asset.

For a long-term gain the calculator stacks the gain on top of your other taxable income and fills the 0, 15 and 20 percent rate bands in order. For a short-term gain it instead measures how much extra ordinary income tax the gain adds at your marginal rates. The chart shows exactly how many dollars land in each band.

A worked example

Suppose you bought stock for 20,000 dollars, sold it for 50,000 dollars after three years, and have 90,000 dollars of other income as a single filer. The 30,000 dollar long-term gain sits above your income, so most of it is taxed at 15 percent, giving roughly 4,500 dollars of tax. Because your income stays under the threshold, no net investment income tax applies here.

Things to keep in mind

Brackets and thresholds change each year and vary by filing status, so the figures here are estimates based on recent federal numbers. State taxes are not included. For the official rules straight from the source, see the IRS guide to capital gains. If you are reinvesting the proceeds, our future value calculator can project how the after-tax amount might grow.

Frequently asked questions

What is the difference between short-term and long-term gains?

A short-term gain comes from an asset you held one year or less, and it is taxed at your ordinary income rates. A long-term gain comes from an asset held more than a year, and it gets the lower 0, 15 or 20 percent rates. Holding for just over a year can sharply cut the bill.

How are long-term capital gains rates decided?

Long-term rates depend on your total taxable income, not the gain alone. The gain stacks on top of your other income, so the first dollars may fall in the 0 percent band, the next in the 15 percent band, and the highest dollars in the 20 percent band, all based on income breakpoints for your filing status.

What is the net investment income tax?

The net investment income tax is an extra 3.8 percent that applies to investment income, including capital gains, once your modified adjusted gross income passes a threshold of 200,000 dollars for single filers or 250,000 dollars for joint filers. It is charged on the smaller of the gain and the amount over the threshold.

Does this calculator include state taxes?

No. This tool estimates only US federal capital gains tax and the net investment income tax. Many states tax capital gains as ordinary income, so your real total may be higher. Treat the result as an estimate and confirm specifics with a tax professional.

Related guides

View all →

Advertisement