Calculator Uni

Capital Gains Tax Calculator

Estimate federal tax on an investment gain at short- and long-term rates.

Quick answer

Assets held more than one year are taxed at long-term capital gains rates of 0%, 15%, or 20% depending on total taxable income; held a year or less, the gain is taxed as ordinary income at your marginal rate. The gain stacks on top of your other taxable income to determine which band it falls into.

Sale details
$
$
$

Federal capital gains tax

$6,000

15.0% of the gain

Capital gain

$40,000

After-tax profit

$34,000

If held under a year

$9,333

Difference

$3,333

Federal tax only. State capital gains tax, the 3.8% net investment income tax on higher incomes, and collectibles or real-estate recapture rules aren't included. Uses 2025 brackets.

One year changes everything

Sell an asset you have held for a year or less and the gain is taxed as ordinary income, at your marginal rate — up to 37% federally. Hold it more than a year and it becomes a long-term gain, taxed at 0%, 15%, or 20% depending on your total taxable income. The holding period runs from the day after you acquired the asset through the day you sold it.

Worked example: a $40,000 long-term gain

Buy at $50,000, sell at $90,000, and the gain is $40,000. For a single filer with $90,000 of other taxable income, that whole gain sits in the 15% band, so the federal tax is $6,000 and the after-tax profit $34,000. Sold at eleven months instead, the same gain is ordinary income stacked on top of $90,000 — about $9,333 in tax. Waiting a few more weeks would have been worth $3,333.

Long-term rates stack on your income

The 0/15/20% brackets are not based on the gain alone: the gain stacks on top of your ordinary taxable income and fills whatever space is left in each band. In 2025 a single filer pays 0% on long-term gains while total taxable income stays under $48,350 and 15% up to $533,400; for married filing jointly the thresholds are $96,700 and $600,050. A large gain can therefore straddle two rates.

Basis is more than the purchase price

Cost basis includes commissions and, for property, capital improvements — a new roof adds to basis, a repainted wall generally doesn't. Reinvested dividends raise the basis of a fund position, and inherited assets are stepped up to their value at the date of death, which often erases decades of gain. Getting basis right is the most common way people overpay this tax.

What this doesn't cover

State tax is separate and varies enormously — some states have no capital gains tax, others tax gains as ordinary income. Above $200,000 single or $250,000 joint in modified AGI, a further 3.8% net investment income tax applies. Special rules govern collectibles at 28%, unrecaptured depreciation on rental property at 25%, and the primary-residence exclusion of $250,000 single or $500,000 joint. Treat this as a planning estimate, not a filing figure.

Frequently asked questions

How much tax do I pay on a $40,000 capital gain?
For a single filer with $90,000 of other taxable income, a long-term gain of $40,000 falls in the 15% band, so federal tax is about $6,000. The same gain held under a year would be taxed as ordinary income — roughly $9,333 at the 22% and 24% marginal rates.
What are the 2025 long-term capital gains rates?
Zero, 15%, or 20%, set by your total taxable income. Single filers pay 0% up to $48,350, 15% up to $533,400, and 20% above that. For married filing jointly the thresholds are $96,700 and $600,050. The gain stacks on top of your ordinary income to determine which band it falls in.
How long do I have to hold an asset to get long-term rates?
More than one year. The clock starts the day after you acquire the asset and runs through the day you sell it, so selling at exactly twelve months is still short-term. On a large gain, a few extra days can be worth thousands.
Can capital losses reduce my tax?
Yes. Losses offset capital gains of the same type first, then the opposite type, and any remaining net loss can offset up to $3,000 of ordinary income per year. Anything beyond that carries forward indefinitely to future tax years.

Sources & methodology

Related calculators