How it works
The same rules the calculator uses, in plain language — then jump back up and estimate your sale.
How capital gains tax is calculated in the United States
A capital gain is the profit you realise when you sell a capital asset — such as stocks, ETFs, mutual funds, cryptocurrency, real estate, or collectibles — for more than your adjusted cost basis. The IRS taxes realised gains; unrealised paper gains in a brokerage account are generally not taxable until you sell. That timing flexibility is why planning around holding periods and income brackets can matter so much.
The basic federal formula is straightforward: capital gain equals sale proceeds minus adjusted cost basis minus selling expenses. Adjusted basis starts with what you paid and can increase for commissions, reinvested dividends, or capital improvements (for real estate), and can decrease for depreciation claimed on investment property.
Short-term vs long-term capital gains
The single most important federal factor is the holding period. Assets held 365 days or less generally produce short-term capital gains taxed as ordinary income at rates up to 37%. Assets held more than one year generally qualify for preferential long-term rates of 0%, 15%, or 20%, depending on your taxable income and filing status.
If you are within about 30 days of crossing the one-year mark, waiting can convert a short-term gain into a long-term gain and materially reduce federal tax. Our calculator flags that cliff and estimates the difference so you can see the trade-off before you sell.
Federal brackets, NIIT, and state tax layers
Long-term gains are stacked on top of your other taxable income. That “gain stacking” method means part of a large gain can fall into the 0% bracket, part into 15%, and part into 20%. Short-term gains simply increase ordinary taxable income and move through the progressive ordinary brackets.
High earners may also owe the 3.8% Net Investment Income Tax under IRC Section 1411 when MAGI exceeds the applicable threshold. NIIT stacks on top of the regular capital gains tax and can push the effective top federal long-term rate to 23.8%.
State tax is a separate layer. Some states impose no income tax on capital gains. Others use flat rates or tax gains as ordinary income under graduated brackets. A few — notably Washington, North Dakota, and Montana — apply special capital gains rules. Combined federal-plus-state effective rates can exceed 37% for top earners in high-tax states such as California.
Asset-class rules that change the math
Not every asset uses the same maximum rate. Collectibles can face a 28% long-term federal ceiling. Primary residence sales may qualify for the Section 121 exclusion of up to $250,000 ($500,000 MFJ). Investment real estate can trigger depreciation recapture taxed at up to 25%. Qualified Small Business Stock may qualify for a Section 1202 exclusion after a five-year hold — though state conformity varies.
Cryptocurrency is treated as property. Trades, swaps, and spending crypto can each be taxable events. Wash-sale disallowance currently applies more clearly to securities than to crypto, which is an important planning distinction for loss harvesting.
How to use this free calculator
Enter your asset type, buy and sell prices, quantity, dates, filing status, approximate taxable income before the gain, and state. The tool estimates federal tax, NIIT when applicable, state tax, total tax owed, effective rate, and after-tax proceeds — then suggests personalised optimisation ideas such as holding for long-term treatment or checking Section 121 eligibility.
Use the state hub to open a calculator pre-selected for your state, or jump to asset-specific pages for stocks, crypto, real estate, and collectibles. For the calculation methodology, data sources, and update process, see our methodology page. Estimates are informational only; confirm figures with IRS publications and a licensed tax professional before filing.
Step 1
Your tax profile
Year, filing status, state, and income before the gain.
Step 2
What you sold
Asset type, optional name, prices, and quantity.
Step 3
Buy and sell dates
We classify short-term vs long-term from those dates.
IRC sections this calculator models
Section 121Primary residence exclusion
May exclude up to $250,000 of gain ($500,000 if married filing jointly) on a qualifying primary home if ownership and use tests are generally met for two of the five years before the sale.
Section 1031Like-kind exchanges
May defer gain on qualifying investment or business real property swapped for other qualifying US real property, subject to identification and 45/180-day timing rules and a Qualified Intermediary. This calculator estimates a taxable sale; it does not model a completed 1031 exchange.
Section 1411Net Investment Income Tax (NIIT)
Adds 3.8% on net investment income, including capital gains, when MAGI exceeds $200,000 (single / head of household), $250,000 (married filing jointly), or $125,000 (married filing separately). Reported on Form 8960.
Section 1250Unrecaptured depreciation
Depreciation claimed on real property may be taxed as unrecaptured Section 1250 gain at a maximum 25% federal rate when you sell investment or converted property.
Section 1202Qualified Small Business Stock (QSBS)
May exclude a large share of gain on qualifying C-corporation stock held more than five years, subject to dollar and basis caps. State conformity varies — California generally does not follow the federal exclusion.
For 1031 timing rules see the1031 exchange guideand thereal estate calculator.
Long-term capital gains brackets (2025 vs 2026)
Thresholds are taxable-income ceilings for the 0% and 15% long-term rates. Amounts above the 15% ceiling are taxed at 20%. 2026 cutoffs follow IRS Revenue Procedure 2025-32 — the same tables the calculator engine uses.
| Filing status | 2025 0% up to | 2025 15% up to | 2026 0% up to | 2026 15% up to |
|---|---|---|---|---|
| Single | $48,350 | $533,400 | $49,450 | $545,500 |
| Married filing jointly | $96,700 | $600,050 | $98,900 | $613,700 |
| Married filing separately | $48,350 | $300,000 | $49,450 | $306,850 |
| Head of household | $64,750 | $566,700 | $66,200 | $579,600 |
Short-term gains as ordinary income (2026, Single)
Assets held one year or less are stacked as ordinary income at 10% through 37%. Other filing statuses use the same engine tables with different cutoffs.
| Rate | Taxable income up to |
|---|---|
| 10% | $12,400 |
| 12% | $50,400 |
| 22% | $105,700 |
| 24% | $201,775 |
| 32% | $256,225 |
| 35% | $640,600 |
| 37% | No limit |
Capital loss carryover
Capital losses offset capital gains dollar-for-dollar. If losses exceed gains, you may deduct up to $3,000 ($1,500 if married filing separately) against ordinary income in that year and carry remaining losses forward.
Annual ordinary-income deduction cap $3,000 or $1,500 if married filing separately.
IRS forms that report capital gains
- Form 8949. Lists each sale or disposition of a capital asset (dates, proceeds, and basis adjustments) before totals move to Schedule D.
- Schedule D. Summarizes net short-term and long-term gains or losses from Form 8949 and applies capital-loss carryovers.
- Form 8960. Computes the 3.8% NIIT under IRC Section 1411 when MAGI exceeds the applicable threshold.
- Form 1099-B. Broker proceeds and often cost basis for securities sales, which you reconcile on Form 8949.
- Form 1099-DA. Digital asset proceeds reporting from brokers and exchanges; still reconcile each disposal as property for federal capital gains.
Explore calculators
Jump by state, asset, or filing status — or read how we model the numbers.
