Finance tools
Capital gains tax calculator
Use this free capital gains tax calculator to estimate 2026 federal tax when you sell stocks, ETFs, crypto, or other investments. Enter cost basis, sale price, how long you held the asset, filing status, and other taxable income (after deductions—not gross salary). You’ll see tax on the profit from the sale, a short-term vs long-term comparison, and after-tax proceeds. State tax and NIIT (3.8%) are available under Advanced options. Export CSV or PDF with no sign-up. Estimating annual wages or a refund? Try the income tax calculator. Need average cost across several buys? Use the stock average calculator first, then enter that basis here.
What this capital gains tax calculator does
Built for a single sale—one stock position, crypto disposal, or similar transaction—you get a 2026 federal estimate in seconds. The number that matters is tax on your gain (profit), not tax on the entire sale price. We also show what the same gain would cost if it were taxed as short-term versus long-term, so you can see the holding-period impact without running two scenarios by hand.
Open Advanced options to add broker fees, a rough state tax layer, or NIIT when high income may apply. Everything stays in your browser; you can export a summary anytime.
It won’t file your return or match broker tax lots. For paycheck withholding and refunds, use the income tax calculator. For official rules, see IRS Topic 409.
What are capital gains?
A capital gain is usually the profit when you sell something for more than your cost basis—what you paid, plus eligible adjustments like purchase commissions. People most often think about gains on stocks, ETFs, mutual funds, and crypto, but the same idea applies to many capital assets, including some investment property.
Paper profits in your portfolio are generally unrealized until you sell. That’s when the gain is realized and typically enters the tax picture. How long you owned the asset before selling determines whether the IRS treats the gain as short-term or long-term, which changes the federal rate structure.
New to the terms? Investor.gov explains capital gains in plain language.
Capital gains formula (basis, sale price, and gain)
Gain on a single sale
Gain = Sale price − Cost basis − Selling costsExample: Bought shares for $10,000, sold for $25,000, no selling costs → $15,000 long- or short-term gain depending on holding period.
After-tax proceeds ≈ sale price − selling costs − total tax on the gain (federal, optional state, optional NIIT).
Cost basis is generally your purchase price plus buy-side fees. If you bought in multiple trades, compute a weighted average with the stock average calculator and enter that total or per-share equivalent here.
Capital losses (sale below basis) are discussed below; this tool focuses on estimating tax when gain > 0.
Short-term vs long-term capital gains
The IRS tests holding period from the day after purchase through the sale date. One year or less → short-term; more than one year → long-term for most marketable securities.
| Short-term | Long-term | |
|---|---|---|
| Holding period | 1 year or less | More than 1 year |
| Federal rate structure | Ordinary income (10%–37%) | 0%, 15%, or 20% on most investments |
| What income matters | Taxable income + gain stacks in ordinary brackets | LTCG bands stack on taxable income |
| In this tool | Select Short-term | Select Long-term (default) |
After you calculate, compare short-term and long-term federal tax on the same gain—especially helpful if your sale date is close to the one-year line.
How to calculate capital gains tax
Find your realized gain
Subtract cost basis from sale price. Add selling costs in advanced options if commissions reduce your gain.
Choose holding period
Use the Short-term or Long-term toggle at the top of the form. If you held the asset one year or less, it’s short-term; more than a year is long-term for most securities.
Enter other taxable income
Use annual taxable income after the standard or itemized deduction and pre-tax deferrals — not gross W-2 wages — so brackets and LTCG bands stack correctly.
Read federal tax on the gain
Read the main tax-on-gain estimate, then check the breakdown, effective rate, after-tax proceeds, and the short-term vs long-term comparison.
Optional: state and NIIT
Expand advanced options to model selling costs, pick a state for a simplified incremental state tax estimate, or include NIIT when MAGI is above IRS thresholds.
2026 long-term capital gains tax rates
For tax year 2026, federal long-term capital gains tax rates on most investments remain 0%, 15%, and 20%. The rate that applies depends on taxable income (including the gain) and filing status. The table uses IRS inflation-adjusted thresholds (Rev. Proc. 2025-32).
| LTCG rate | Single | Married filing jointly | Married filing separately | Head of household |
|---|---|---|---|---|
| 0% | Up to $49,450 | Up to $98,900 | Up to $49,450 | Up to $66,200 |
| 15% | $49,451 – $545,500 | $98,901 – $613,700 | $49,451 – $306,850 | $66,201 – $579,600 |
| 20% | Over $545,500 | Over $613,700 | Over $306,850 | Over $579,600 |
Income in the table means taxable income for the year—including wages, other income, and the capital gain you’re modeling. Your existing income can fill lower LTCG bands before higher rates apply to part of the gain.
How short-term gains use ordinary tax brackets
Short-term gains are taxed like ordinary income—the same federal brackets as wages (10% through 37% for 2026). This calculator measures tax on your gain by comparing total tax with and without that gain included. That marginal approach answers: “How much extra federal tax does this sale add?”
If you already earn enough to sit in higher brackets, a short-term sale can trigger 22%, 24%, 32%, or more on portions of the gain—often much higher than long-term rates on the same profit.
See bracket cutoffs without a sale in the tax bracket calculator, or model full-year wages in the income tax calculator.
Worked example: $15,000 gain with $50,000 taxable income (single, 2026)
Suppose you are single with $50,000 of other taxable income and sell stock for a $15,000 gain (for example $10,000 basis, $25,000 sale). Federal tax on the gain alone differs by holding period:
| Holding period | Federal tax on $15k gain (approx.) | Why |
|---|---|---|
| Long-term | $2,250 | 15% LTCG rate on gain stacked above $50k ordinary income |
| Short-term | $3,260 | Marginal ordinary brackets on income + gain vs income alone |
Plug $10,000 basis, $25,000 sale, $50,000 other taxable income, and single filing into the form above—you should see about $2,250 long-term and $3,260 short-term federal tax on the gain. Change filing status, income, state, or NIIT and the numbers will move with your situation.
State capital gains and income tax
Federal and state taxes are separate. Most states with an income tax treat capital gains like other taxable income; a few offer breaks this tool does not model line-by-line. States with no income tax may still have other fees or local rules not included here.
Turn on Include state income tax estimate in Advanced options and pick your state for a rough add-on. In high-tax states such as California, state tax can be a large share of the bill even when federal long-term rates are 15% or 20%.
Need a full-year wage picture? The income tax calculator covers federal and state on salary; figures here are sale-specific planning only.
Net investment income tax (NIIT)
The Net Investment Income Tax (NIIT) is an additional 3.8% federal tax on certain investment income (including capital gains) when your modified adjusted gross income (MAGI) exceeds filing-status thresholds. It is separate from ordinary and LTCG rates.
This calculator applies a simplified NIIT estimate on the gain when you enable the toggle — it does not prepare Form 8960 or model every MAGI adjustment (for example foreign income exclusions).
| Filing status | MAGI threshold (2026 planning) |
|---|---|
| Single | $200,000 |
| Married filing jointly | $250,000 |
| Married filing separately | $125,000 |
| Head of household | $200,000 |
NIIT is generally levied on the lesser of net investment income or MAGI above the threshold. Toggle NIIT in advanced options when your income profile may trigger it.
Home sales, rentals, and inherited property
Primary residence (sale of home): IRC §121 may let you exclude up to $250,000 of gain (single) or $500,000 (married filing jointly) if you owned and used the home as your main residence for required periods. Many sellers owe no federal gain tax after the exclusion — but eligibility rules are fact-specific. This calculator does not apply the exclusion; enter only the taxable portion of gain if you already know it.
Rental or investment property: Use adjusted basis (purchase + improvements − depreciation deducted). Sale proceeds minus selling expenses go in the sale price field. Depreciation recapture (taxed as ordinary income up to 25% on real estate) and 1031 like-kind exchanges are not modeled — work with a CPA for rental dispositions.
Inherited property: Beneficiaries often receive a step-up in basis to fair market value on the date of death (or alternate valuation date). Your gain on a later sale is generally based on that stepped-up basis, not the decedent’s original purchase price.
For projected home value before a sale, see the real estate appreciation calculator (value only — not tax).
Capital losses and tax-loss harvesting
When you sell for less than basis, you realize a capital loss. Losses can offset capital gains dollar for dollar. If losses exceed gains, you can typically deduct up to $3,000 ($1,500 if married filing separately) against ordinary income per year, carrying additional losses forward.
Tax-loss harvesting is the strategy of selling losers to offset winners — subject to the wash-sale rule, which can disallow a loss if you buy a substantially identical security within 30 days before or after the sale.
This calculator models one sale at a time. If you already netted gains and losses elsewhere, enter a net gain manually or run separate what-if sales.
Limitations of this calculator
- No primary-residence §121 exclusion ($250k / $500k) wizard
- No 1031 exchange, depreciation recapture, or collectibles 28% rate
- No multi-lot FIFO/specific ID or wash-sale adjustments
- State tax uses simplified incremental estimates — not every state conforms
- Planning estimate only — not tax, legal, or investment advice
Learn more from IRS Topic 409 and Investor.gov.
More free tools
Discover more calculators for time tracking, payroll, and HR.
Frequently asked questions about this capital gains tax calculator
What is capital gains tax?
Capital gains tax is federal tax on profit when you sell a capital asset for more than your cost basis (what you paid, plus eligible adjustments).
The rate depends on how long you held the asset and your taxable income. The calculator above turns your sale details into a 2026 federal estimate on the gain—not on the full sale price.
How do I calculate my capital gains tax?
Start with gain: sale price minus cost basis (minus selling costs if any).
Tax the gain as short-term (ordinary federal brackets on the marginal amount) or long-term (0%, 15%, or 20% bands stacked on your other taxable income).
Enter filing status and other taxable income so brackets stack correctly, then read federal tax on the gain, optional state/NIIT, and after-tax proceeds.
How do I use a capital gains tax calculator for stock sales?
Enter cost basis (what you paid, including buy fees), sale proceeds, and whether the sale is short-term or long-term.
Multiple purchases? Get a weighted average with the stock average calculator, then use that as basis here. Broker CSV import and automatic FIFO are not included—enter the basis your records support.
How much capital gains tax will I pay on $100,000?
There is no single percentage for a $100,000 gain—it depends on holding period, filing status, and other taxable income.
A $100k long-term gain may span 0%, 15%, or 20% federal bands; a short-term $100k gain is taxed like ordinary income. Run your numbers with the same gain under both terms to compare.
How much capital gains tax will I pay on $300,000?
A $300,000 gain rarely has one flat tax rate. Large gains often cross several federal bands in a single year.
Long-term portions may hit 15% and 20% LTCG rates; short-term portions follow ordinary brackets (24%, 32%, 35%, and up). Model filing status, taxable income, and holding period; turn on state tax if you need a combined planning view.
Is capital gains tax 20% or 24%?
20% is the top federal long-term rate on most investments—not 24%.
24% is an ordinary income bracket that often applies to short-term gains taxed like wages. Income, holding period, and gain size together set the effective rate in your results.
What is the difference between short-term and long-term capital gains?
Short-term gains are taxed like wages (ordinary federal brackets). Long-term gains on most investments use preferential 0%, 15%, or 20% rates when you held the asset more than one year.
The holding period clock usually starts the day after you buy. Use the short-term vs long-term comparison on the same sale to see the federal difference—especially near the one-year mark.
What are the long-term capital gains tax rates for 2026?
For 2026, federal long-term rates on most investments remain 0%, 15%, and 20%.
Which rate applies depends on total taxable income (including the gain) and filing status—see the rate table on this page. Collectibles and certain other assets can use different rates; this tool uses standard LTCG bands.
Why does my capital gains tax estimate look so high?
Short-term gains use ordinary income brackets—if you already have substantial taxable income, the sale can push part of the gain into 22%, 24%, or higher federal bands.
Using gross salary instead of taxable income, or treating the full sale price as taxable instead of only the gain, also inflates estimates.
Compare long-term vs short-term in the results panel; enable NIIT in advanced settings when MAGI may exceed IRS thresholds.
Should I enter gross salary or taxable income?
Enter taxable income—the amount on your return after deductions and before this sale’s gain.
Gross W-2 wages are usually too high. Estimate taxable income with the income tax calculator first if needed, then use that figure here.
What is the Net Investment Income Tax (NIIT)?
NIIT is an extra 3.8% federal tax on net investment income when MAGI is above IRS thresholds ($200k single, $250k MFJ, $125k MFS, $200k HOH for planning).
It stacks on top of ordinary or LTCG tax on the gain. Turn on NIIT in advanced options for a simplified estimate—not a full Form 8960 calculation.
Does this calculator include state capital gains tax?
Yes—optionally. Enable state tax in advanced settings and choose your state for a simplified incremental estimate on income including the gain.
No-income-tax states add little or nothing; high-tax states can add a large bill on top of federal results. This is planning math, not a state return, and may not reflect every state’s preferential CG rule.
Does California tax capital gains differently?
California generally taxes capital gains as ordinary income for individuals—there is no separate state long-term rate like the federal 0%/15%/20% structure.
Select California under state tax in advanced options for a simplified estimate. Combined federal + state totals can be much higher than federal-only results.
Does this work for crypto?
Yes for a straightforward sale: enter USD cost basis, sale proceeds, and short- or long-term holding period.
Exchange CSV import, wallet tracking, and specific lot IDs are not supported. Staking, airdrops, and token swaps need specialist tax software.
How do I calculate capital gains tax on rental property?
Start with adjusted basis: purchase price plus capital improvements minus depreciation you claimed while renting.
Use that as cost basis and your net sale price as sale price, then pick short- or long-term holding. To estimate a depreciation schedule while you own the property, try our depreciation calculator. Depreciation recapture is not broken out here—a CPA can model a full rental sale.
Does this calculator handle home sale exclusions?
Not automatically. On a primary home you may exclude up to $250,000 of gain (single) or $500,000 (married filing jointly) when you meet IRS ownership and use tests.
Enter only the taxable portion of gain after any exclusion, or use this tool for investments and second homes. Rules: IRS Topic 701.
How can I avoid capital gains tax on a home sale?
Many homeowners owe no federal gain tax on a primary residence when they qualify for the IRS exclusion—up to $250,000 (single) or $500,000 (married filing jointly).
Ownership and use tests apply. This calculator does not apply the exclusion—it estimates tax on the taxable part of a gain or on other assets. See IRS Topic 701 — Sale of your home.
Do I pay capital gains tax on inherited property?
Inheritance itself is not a sale, but when you later sell inherited property, tax is usually based on gain above stepped-up basis—often fair market value at the date of death.
That step-up can greatly reduce taxable gain versus the decedent’s original purchase price. Enter stepped-up basis from estate or broker records. Community property, joint tenancy, and alternate valuation dates can change basis—this tool does not compute them.
How does this relate to average stock price?
Cost basis for tax is often your average purchase price when you bought the same stock multiple times.
Use the stock average calculator for the weighted average, then enter that total or per-share basis when you sell.
Can I offset gains with losses?
Yes. Capital losses offset capital gains first, then up to $3,000 of other income per year ($1,500 MFS), with excess carried forward.
The wash-sale rule may disallow a loss if you rebuy a substantially identical security within 30 days. Enter a net gain here if you have already netted other sales.
Can I export my capital gains tax results?
Yes—free, no sign-up. After you calculate, download a CSV or PDF with inputs, tax breakdown, and disclaimer.
Files are generated in your browser; we do not store your numbers on a server.
Is this capital gains tax calculator tax advice?
No. Ordio provides educational calculators, not personalized tax, legal, or investment advice.
Use results for planning, then confirm with a CPA, enrolled agent, or tax software before you file or make large financial decisions.