A U.S. federal guide to capital gains tax: the one-year holding-period rule, short-term vs long-term rates, cost basis, netting losses, and a worked estimation example.
This guide covers U.S. federal rules only; state taxes are separate and vary by state. A capital gain is the amount by which an asset's sale price exceeds its adjusted cost basis. The federal tax on that gain depends on one fact above all: whether you held the asset for more than one year. Short-term gains are taxed like wages; long-term gains enjoy their own, lower rate schedule. This guide explains both, how the holding period works, and how to produce a reasonable estimate.
Short-term vs long-term: two different rate systems
The brackets and thresholds change with each tax year, so check the current-year tables in IRS Publication 544 or Topic no. 409 rather than relying on last year's numbers.
- Short-term capital gains — from assets held one year or less — are taxed as ordinary income at your marginal federal rate.
- Long-term capital gains — from assets held more than one year — are taxed at 0%, 15% or 20% depending on your taxable income, with an additional 3.8% net investment income tax (NIIT) applying above certain income thresholds.
The one-year holding-period rule
The rule is exact: more than one year means long-term. Held exactly one year or less means short-term. The holding period starts the day after you acquire the asset and ends on the day you sell it. Buy on January 10 and sell the following January 10, and the sale is short-term.
Cost basis: what you subtract
Your gain is not simply sale price minus purchase price. Adjusted cost basis generally includes:
Inherited and gifted assets follow special basis rules. Whatever the asset, keep records: the basis you can support determines the tax you actually pay.
- The original purchase price.
- Acquisition costs such as broker commissions and fees.
- Capital improvements you made (more relevant to property than to securities).
- Reductions such as depreciation taken on rental or business property.
How to estimate your capital gains tax
Example: an asset is sold for $50,000 with an adjusted cost basis of $35,000, giving a gross gain of $15,000. If the gain is long-term and your effective long-term rate is 15%:
$15,000 × 15% = $2,250 estimated tax, leaving a net gain after tax of $12,750.
This is an arithmetic scenario, not a determination that 15% is the correct legal rate for your return. Your effective rate depends on your taxable income, filing status, asset type and other gains and losses for the year.
Estimated tax = max(0, sale price − adjusted basis − applicable deduction) × effective rate
Offsetting gains with losses
Losses follow a netting order: short-term losses first offset short-term gains, and long-term losses first offset long-term gains. The two nets are then combined. If your total losses exceed your gains, you can use up to $3,000 per year ($1,500 if married filing separately) to offset ordinary income, carrying any remainder forward to future years.
Two related rules worth knowing. A wash sale occurs when you sell a security at a loss and, within 30 days before or after that sale, buy a substantially identical security (or a contract or option to buy one). The loss is then disallowed on that sale; instead, it is added to the cost basis of the replacement holding, so the tax benefit is deferred rather than lost. And the home sale exclusion may let you exclude up to $250,000 of gain ($500,000 for certain married couples filing jointly) if you owned and used the home as your main residence for at least two of the five years before the sale. Verify both rules with the IRS before relying on them.
State taxes
Most states tax capital gains on top of the federal tax, but rates and rules vary widely — some tax gains as ordinary income, some offer partial exclusions, and a few have no income tax at all. Check your state's rules when you plan a sale.
Open the Capital Gains Tax Calculator →
Frequently asked questions
What capital gains tax rate will I pay?
Short-term gains (held one year or less) are taxed as ordinary income at your marginal federal rate. Long-term gains (held more than one year) are taxed at 0%, 15% or 20% depending on taxable income, plus a possible 3.8% net investment income tax for higher incomes. Brackets and thresholds change each tax year, so verify the current-year tables with the IRS.
Is the one-year holding period rule exact?
Yes. You must hold the asset for more than one year for long-term treatment. If the sale is exactly one year or less after acquisition, the gain is short-term. The holding period starts the day after acquisition and ends on the sale date.
Does the calculator compute my final tax liability?
No. It applies the effective rate you supply to the estimated taxable gain. Bracket thresholds, income stacking, the net investment income tax and state taxes are not modeled, so treat the result as an estimate to confirm with official guidance or a tax professional.
What counts toward my cost basis?
Generally the purchase price plus acquisition costs such as commissions and fees. Improvements can increase basis, and depreciation can reduce it for rental or business property. Inherited and gifted assets have special rules. Keep records to support the basis you claim.
Can capital losses cancel my gains?
Often yes. Short-term losses first offset short-term gains and long-term losses first offset long-term gains, then the results are combined. If total losses exceed gains, up to $3,000 can offset ordinary income per year ($1,500 if married filing separately), with the remainder carried forward to future years.
Do I owe state tax on capital gains too?
Most states tax capital gains, but rates and rules vary widely. Some states tax them as ordinary income, some offer exclusions, and a few have no income tax at all. Check the rules for your state.
What about selling my home?
If you owned and used the home as your main residence for at least two of the five years before the sale, you may be able to exclude up to $250,000 of gain ($500,000 for certain married couples filing jointly). Eligibility and limits have specific requirements, so verify with IRS Topic no. 701.
Sources and further reading
- IRS: Topic no. 409, Capital Gains and Losses
- IRS Publication 544: Sales and Other Dispositions of Assets
- IRS Publication 550: Investment Income and Expenses
- IRS Publication 551: Basis of Assets
- IRS: Topic no. 701, Sale of Your Home
Last reviewed: 2026-10-09. See our editorial policy.
Related calculators
Estimates only; not financial, tax or legal advice. Confirm figures with your lender or a licensed professional. Full disclaimer