Skip to content

Capital Gains Tax Calculator

Estimate the federal tax on selling an investment at a profit, based on how long you held it, your filing status, and your other taxable income.

Free No signup Runs in your browser

Your Details

Holding Period

Your taxable income for the year excluding this gain (after deductions).

State-specific calculation is not currently available for this state. You can enter your own estimated effective rate; it will be labelled as your assumption.

Your calculations are performed locally in your browser. Nothing you enter is sent or stored.

Your Results Estimate

Estimated Total Tax on This Gain —
Capital Gain
—
Estimated Federal Tax
—
Estimated State Tax
—
Effective Tax Rate
—
Net Gain After Estimated Tax
—

Tax estimates are simplified and not tax advice. Actual tax liability depends on your complete tax situation and applicable laws.

About the Capital Gains Tax Calculator

In the U.S., a capital gain is the profit from selling an asset for more than your cost basis. How much tax applies depends mainly on the holding period: assets held more than one year usually qualify for lower long-term rates of 0%, 15%, or 20%, while short-term gains are taxed at the same rates as wages.

The calculator uses the published IRS brackets for the tax year you select, stacks the gain on top of your other taxable income, and adds the 3.8% Net Investment Income Tax when your income is above the threshold. Results are estimates, not tax advice.

How It Works

The capital gain is the sale price minus the purchase price (your cost basis). Include purchase commissions in the basis and selling costs by reducing the sale price if you want them reflected.

Long-term gains fill the 0%, 15%, and 20% bands in order, starting after your other taxable income. Short-term gains are added to your other taxable income and taxed at ordinary income rates. Collectibles held long-term use ordinary rates capped at 28%. For a primary residence held long-term, the home-sale exclusion ($250,000, or $500,000 for joint filers) is subtracted first, assuming you meet the ownership and use tests.

State tax is calculated only where verified data is available. For other states you can enter your own estimated rate, which is clearly labelled as your assumption.

Formula

Capital gain
Gain = Sale Price − Purchase Price
Long-term gain stacking
Tax = 15% × gain between T0 and T15 + 20% × gain above T15
  • T0maximum 0% rate amount for your filing status (e.g. $49,450 single, 2026)
  • T15maximum 15% rate amount (e.g. $545,500 single, 2026)
Short-term gain
Tax = Tax(other income + gain) − Tax(other income)
Net Investment Income Tax
NIIT = 3.8% × min(gain, income + gain − threshold)

Thresholds by filing status and year come from the centralized tax data (IRS Rev. Proc. 2024-40 for 2025 and Rev. Proc. 2025-32 for 2026).

Example

A single filer with $60,000 of other taxable income sells shares bought for $20,000 at $50,000 after holding them for more than a year (2026 tax year).

Inputs

Gain
$30,000
Holding period
Long-term
Other taxable income
$60,000
State
Florida (no income tax)

Results

Estimated federal tax
$4,500.00
Effective rate
15.00%
Net gain after tax
$25,500.00

Because $60,000 of other income is already above the 2026 0% threshold of $49,450, the whole gain falls in the 15% band. If the same shares had been held one year or less, the gain would be taxed at 22% ordinary rates — about $6,600.

Assumptions & Limitations

  • Tax year: brackets, thresholds and exclusions come only from the tax year you select. Years are never mixed.
  • Other taxable income is treated as ordinary income after deductions; qualified dividends and other capital gains are not modelled separately.
  • NIIT uses taxable income as a stand-in for modified adjusted gross income, which may understate it.
  • Not included: depreciation recapture on real estate (up to 25%), capital loss carryovers, the alternative minimum tax, credits, and wash-sale rules.
  • State tax: calculated only for states with verified data; otherwise shown as not available unless you enter your own rate.

Understanding Your Results

  • Estimated Total Tax: Federal capital gains tax plus NIIT plus state tax where available.
  • Effective Tax Rate: Total estimated tax as a percentage of the gain.
  • Net Gain After Estimated Tax: What remains of the gain after the estimated taxes.
  • Bracket chart: Shows how much of the gain falls into each federal rate band.

Frequently Asked Questions

What is the difference between short-term and long-term capital gains?
Assets held for one year or less produce short-term gains, taxed at ordinary income rates. Assets held for more than one year usually produce long-term gains, taxed at 0%, 15%, or 20% depending on taxable income and filing status.
Is cryptocurrency taxed the same way as stocks?
The IRS treats cryptocurrency as property, so selling or exchanging it generally produces a capital gain or loss using the same short-term and long-term rules.
Why do collectibles have a different rate?
Long-term gains on collectibles such as art, coins, and precious metals are taxed at ordinary rates up to a maximum of 28%, instead of the 0%/15%/20% rates.
Do I pay tax when I sell my home?
Many homeowners can exclude up to $250,000 of gain ($500,000 for married couples filing jointly) if they owned and lived in the home for at least 2 of the 5 years before the sale. Gain above the exclusion is taxable.
What is the Net Investment Income Tax?
It is an additional 3.8% tax on investment income for taxpayers with modified adjusted gross income above $200,000 (single or head of household), $250,000 (married filing jointly), or $125,000 (married filing separately).
Why is my state tax "not available"?
State rules differ widely, and this calculator only includes state data that has been verified. For other states you can enter your own estimated rate to include it in the total.