What the Capital Gains Tax Calculator (US) does
This capital gains tax calculator estimates the US federal tax on selling shares, a home, land or another asset: it decides whether the gain is short or long-term from your dates, stacks it on your other income to find the 0%, 15% or 20% rate, adds the 3.8% net investment income tax, and applies the $250,000/$500,000 home-sale exclusion.
Because capital gains rates depend on your other taxable income, the calculator works out your federal tax with and without the sale and reports the difference - the tax this sale actually causes. It uses the IRS thresholds for tax year 2026 (and 2027 for planning) and runs entirely in your browser.
How to use it
- Enter the sale price, your cost basis (purchase price plus buying costs and, for property, capital improvements) and any selling costs.
- Enter the purchase and sale dates. Held more than one year is long-term; one year or less is short-term. You can also pick the holding period yourself.
- Choose the tax year of the sale and your filing status, and enter your other income for the year before deductions.
- If you are selling your main home, tick the Section 121 box. Enter a reduced exclusion only if you qualify for a partial one.
- Read the tax on the gain, the rate band it falls in, any NIIT, and what you keep after tax.
Reading the results
The tax shown is the extra federal tax caused by this sale, so it already reflects where your other income sits. A long-term gain can be split across two rates: for example part at 0% and part at 15% when it crosses the threshold.
Short-term gains are taxed as ordinary income at your bracket rates, which can be nearly double the long-term rate. If you are close to the one-year mark, the dates matter.
The effective rate on the gain is the tax divided by the gain. It is useful for comparing sales, while the rate band tells you what the next dollar of gain would cost.
Worked example: shares bought for $35,000 and sold for $60,000 after three years, single, $85,000 salary, 2026
The gain is $60,000 - $35,000 = $25,000, long-term because the shares were held more than a year.
Taxable income without the sale is $85,000 - $16,100 = $68,900, already above the $49,450 top of the 0% band for single filers, and $68,900 + $25,000 = $93,900 is below $545,500. So all $25,000 is taxed at 15% = $3,750.
Modified AGI of $110,000 is below the $200,000 NIIT threshold, so no NIIT. You keep $60,000 - $3,750 = $56,250. Had the shares been sold after eight months, the same gain would be taxed at 22% instead.
Formulas and scoring rules
- Gain
gain = proceeds - selling costs - cost basis- Holding period
long-term if sold after the one-year anniversary of the purchase dateThe holding period starts the day after you acquire the asset.- Home-sale exclusion
taxable gain = gain - min(gain, $250,000 or $500,000 married filing jointly)Ownership and use tests: 2 of the 5 years before the sale.- Long-term rates
0% up to $49,450 / $98,900 / $66,200 of taxable income (single / joint / head of household, 2026), 15% up to $545,500 / $613,700 / $579,600, 20% aboveGains are stacked on top of ordinary taxable income (Rev. Proc. 2025-32).- Net investment income tax
NIIT = 3.8% x min(net investment income, MAGI - threshold)Thresholds $200,000 single, $250,000 joint, $125,000 separate; not indexed.- Tax caused by the sale
tax = federal tax with the gain - federal tax without it
US federal rules only
The 0%, 15% and 20% rates come from section 1(h) of the Internal Revenue Code and the thresholds are inflation-adjusted each year; the 2026 figures are from IRS Revenue Procedure 2025-32 and the 2027 figures from Revenue Procedure 2026-35. The NIIT is section 1411 and the home-sale exclusion is section 121.
Most states tax capital gains as ordinary income at their own rates, and a few have none. This page shows federal tax only.
Situations with different rules
Unrecaptured depreciation on rental or business property is taxed at up to 25%, and collectibles such as coins or art at up to 28%. Inherited assets get a basis equal to the value at death and are always long-term; gifted assets keep the giver's basis. A 1031 exchange can defer the gain on investment property entirely. Your broker's Form 1099-B and a tax professional can confirm the basis and holding period for complex cases.
Limitations: what the result does not prove
- One sale at a time. It does not net several sales across the year or apply losses carried in from earlier years beyond the current-year $3,000 limit.
- Depreciation recapture, collectibles, qualified small business stock, installment sales and the alternative minimum tax are not modelled.
- It is an estimate, not tax advice. A CPA or enrolled agent should review large or unusual sales.
Privacy: where your data goes
Everything you paste, type or drop is processed in this browser tab. It is not uploaded, logged, stored or sent to analytics. Session recording and tag-manager scripts are switched off on this page.
Standards and sources
- IRS Topic 409 - Capital gains and losses - checked 3 Dec 2026
- IRS Revenue Procedure 2025-32 - 2026 capital gains thresholds
- IRS Topic 559 - Net investment income tax
- IRS Publication 523 - Selling Your Home
- IRS Publication 544 - Sales and Other Dispositions of Assets
Frequently asked questions
How much capital gains tax will I pay?
It depends on how long you held the asset and your total taxable income: long-term gains are taxed at 0%, 15% or 20% and short-term gains at your ordinary bracket rate, plus 3.8% NIIT above $200,000 ($250,000 joint) of income.
What are the 2026 long-term capital gains brackets?
For 2026, long-term gains are taxed at 0% up to $49,450 of taxable income for single filers ($98,900 joint, $66,200 head of household), 15% up to $545,500 ($613,700 joint, $579,600 head of household) and 20% above.
How is short-term capital gains taxed?
A gain on an asset held one year or less is added to your ordinary income and taxed at your normal bracket rates, from 10% to 37%, rather than at the lower long-term rates.
Do I pay capital gains when I sell my home?
Usually not on the first $250,000 of gain ($500,000 married filing jointly) if you owned and lived in the home for at least two of the five years before the sale; gain above that is taxed as a long-term gain.
What is the net investment income tax?
It is an extra 3.8% federal tax on investment income, including capital gains, to the extent your modified AGI is above $200,000 (single), $250,000 (joint) or $125,000 (married filing separately).
Can capital losses reduce my capital gains tax?
Yes. Losses offset gains first, and up to $3,000 of net loss a year ($1,500 married filing separately) offsets ordinary income, with the rest carried forward to future years.
Last reviewed by the A2Z.Tools team against the sources listed above.