Capital Gains Tax Calculator 2025

See your federal capital gains tax on stocks, crypto, or property — short-term vs long-term rates, the 0%/15%/20% brackets, NIIT, and exactly what you keep after tax.

Short vs Long-Term
Side-by-Side Chart
Export to CSV
Free & Private

How the Capital Gains Tax Calculator Works

This calculator turns four numbers you already know — what you paid, what you sold for, how long you held the asset, and your other income — into the federal tax you owe and the cash you actually keep. It starts by computing your gain (sale price minus cost basis). If you held the asset one year or less, that gain is short-term and taxed at your ordinary income rate, so we stack the gain on top of your other taxable income and apply the 2025 federal brackets. If you held longer than a year, the gain qualifies for the preferential long-term rates of 0%, 15%, or 20%, again stacked on your income to find the right band.

On top of that, the tool automatically adds the 3.8% Net Investment Income Tax when your income plus the gain crosses the high-earner threshold. The headline result shows your tax owed and net proceeds, and the comparison panel and chart put short-term and long-term side by side so you can see precisely what holding more than a year is worth. Defaults reflect a typical 2025 scenario, so the page is useful the moment it loads — just replace the numbers with your own.

Who Benefits Most From This Calculator

  • Investors selling stocks, ETFs, or mutual funds who want to know the tax bill before they hit the sell button.
  • Crypto traders estimating tax on coins sold or swapped during the year.
  • Anyone near the one-year mark deciding whether waiting a few more weeks for long-term treatment is worth it.
  • Early retirees and low-income years checking whether a gain fits inside the 0% bracket.
  • High earners who need to factor in the 3.8% NIIT surtax.

Who Should Look Elsewhere

This tool estimates federal capital gains tax on a single sale. If you need to model state capital gains tax, an aggregate of many lots, or specialized situations, you'll want dedicated software or a tax professional. It does not handle depreciation recapture on rental property (taxed up to 25%), the 28% collectibles rate on art and precious metals, qualified small business stock (Section 1202) exclusions, or like-kind (1031) exchanges. For a primary-home sale, apply your $250,000/$500,000 exclusion first and enter only the taxable remainder. And if you're estimating your overall income tax rather than a specific gain, start with the federal income tax calculator instead.

Tax Implications of Capital Gains

Short-term vs long-term. The single biggest lever is the holding period. Sell within a year and your gain is taxed as ordinary income (up to 37%); hold beyond a year and it drops to 0%, 15%, or 20%. Crossing the one-year line can cut the tax on the same profit by a third or more.

The 0% bracket. For 2025, long-term gains are taxed at 0% when total taxable income stays under $48,350 (single) or $96,700 (married filing jointly). Because gains stack on income, only the portion that fits under the ceiling gets the 0% rate.

NIIT 3.8%. A 3.8% Net Investment Income Tax adds to the bill once modified AGI exceeds $200,000 (single) or $250,000 (married filing jointly), pushing the top long-term rate to 23.8%.

State capital gains. Most states tax capital gains as ordinary income, with no special low rate — so a resident of California or New York can owe a substantial additional state tax that this federal calculator does not include. Nine states (such as Florida, Texas, and Washington for most income) levy no state income tax on gains.

Primary-home exclusion. When selling your main residence, the Section 121 exclusion lets you shield up to $250,000 of gain (single) or $500,000 (married filing jointly) if you owned and lived there two of the last five years. Only the excess is taxable. These are estimates — consult a tax professional for your situation.

Tips, Tricks & Things to Watch

  • Hold for more than one year whenever you can — the jump from ordinary rates to 0/15/20% is the easiest tax cut available to an investor.
  • Harvest losses before year-end to offset gains and deduct up to $3,000 against ordinary income, carrying forward the rest.
  • Mind the wash-sale rule — wait 31 days or buy a similar-but-not-identical fund so a harvested loss isn't disallowed.
  • Remember the step-up in basis — inherited assets reset to their value at the date of death, often erasing decades of gain for heirs.
  • Harvest gains in 0% bracket years — in low-income years, sell winners tax-free and rebuy to raise your basis (the wash-sale rule doesn't apply to gains).
  • Use tax-advantaged accounts — gains inside an IRA or 401(k) aren't taxed until withdrawal (or ever, in a Roth).

Capital Gains Tax Formula (2025)

How your gain, holding period, and income combine into the tax you owe.

Gain = Sale Price − Purchase Price (cost basis)

Example:

Bought $10,000 of stock, sold for $18,000

18000 − 10000
= $8,000 gain

Variables:

Sale Price - Proceeds from the sale, net of commissions
Cost Basis - Purchase price plus commissions and improvements

Tax = Gain × Applicable Rate

Example:

$8,000 long-term gain, single, $75,000 other income (15% band)

8000 × 0.15
= $1,200 long-term tax

Variables:

Short-Term - Held ≤ 1 yr — taxed at your ordinary marginal rate
Long-Term - Held > 1 yr — 0%, 15%, or 20% by taxable income

Net Proceeds = Sale Price − (Capital Gains Tax + NIIT)

Example:

$8,000 long-term gain, $1,200 tax, no NIIT

18000 − 1200
= $16,800 net proceeds

Variables:

NIIT - 3.8% surtax when MAGI exceeds $200k single / $250k MFJ

These formulas provide the mathematical foundation for the calculations. Actual results may vary based on rounding, compounding frequency, and specific lender policies.

How We Calculate & Keep This Accurate

Short-term gains are taxed as the top slice of your ordinary income: we compute tax on (other income + gain) minus tax on other income alone, using the 2025 federal brackets. Long-term gains use the 2025 0%/15%/20% rate thresholds, stacked on top of your other taxable income so each portion of the gain is taxed at the rate of the band it lands in. The 3.8% NIIT is added on the lesser of the gain or the amount your income exceeds the filing-status threshold.

We model federal tax only. State capital gains tax, depreciation recapture, the 28% collectibles rate, Section 1202 small-business stock, and 1031 exchanges are not included. Results are estimates for planning and may differ from your filed return.

Data & Freshness

Figures reflect 2025 tax-year data.

Last updated June 9, 2026 · Maintained by the Financial Calculator editorial team.

Estimate only. This calculator provides a federal capital gains tax estimate for planning purposes and is not tax advice. It does not include state taxes, depreciation recapture, or special asset rules. Consult a qualified tax professional before making decisions.

Capital Gains Tax Calculator — Frequently Asked Questions

Answers to the most common questions about short-term vs long-term gains, the 0% bracket, NIIT, home sales, and loss harvesting.

How are capital gains taxed?

A capital gain is the profit you make when you sell an asset — stocks, mutual funds, crypto, a rental property, or a business — for more than you paid for it. The amount you paid, including commissions and improvements, is your cost basis, and the gain is the sale price minus that basis. How the gain is taxed depends almost entirely on how long you held the asset. If you owned it for one year or less, the profit is a short-term capital gain and is taxed at your ordinary income tax rate, exactly like wages — anywhere from 10% to 37% federally. If you held it for more than one year, it is a long-term capital gain and qualifies for preferential rates of 0%, 15%, or 20% depending on your taxable income. Capital gains stack on top of your other income to determine which bracket they fall into. High earners may also owe the 3.8% Net Investment Income Tax, and your state may tax the gain separately. Only realized gains — gains from an actual sale — are taxed; an investment that has risen in value but hasn't been sold is unrealized and not taxed.

What's the difference between short-term and long-term capital gains?

The dividing line is exactly one year, measured from the day after you acquired the asset to the day you sold it. Hold for 365 days or fewer and the gain is short-term, taxed at your ordinary federal income tax rate of up to 37%. Hold for at least a year and a day and the gain becomes long-term, taxed at the much lower 0%, 15%, or 20% rates. The difference is enormous: a taxpayer in the 24% ordinary bracket pays 24% on a short-term gain but only 15% on the identical long-term gain — a 9-percentage-point saving for simply waiting. On a $50,000 gain that is $4,500 kept in your pocket. This is why patient, buy-and-hold investing is so tax-efficient and why selling a winner just before the one-year mark can be a costly mistake. The holding period is tracked per lot, so if you bought shares on multiple dates, each batch has its own clock. This calculator shows both treatments side by side so you can see precisely what crossing the one-year threshold is worth for your specific gain and income.

What is the 0% capital gains bracket?

Many investors are surprised to learn that long-term capital gains can be taxed at 0% federally. For the 2025 tax year, a single filer pays 0% on long-term gains as long as their total taxable income (ordinary income plus the gain) stays at or below $48,350; for married couples filing jointly the ceiling is $96,700. Because gains stack on top of your other taxable income, the 0% rate applies only to the portion of the gain that fits underneath that ceiling — any amount above is taxed at 15%. This creates a powerful planning opportunity in low-income years: early retirement before Social Security and pensions begin, a sabbatical, a gap year, or a year of business losses. In those years you can deliberately sell appreciated investments, pay zero federal tax on the gain, and even reset your cost basis higher by immediately rebuying (the wash-sale rule does not apply to gains). This strategy, called tax-gain harvesting, is the mirror image of tax-loss harvesting and is one of the most underused legal ways to permanently avoid capital gains tax.

What is the Net Investment Income Tax (NIIT)?

The Net Investment Income Tax is an additional 3.8% surtax that applies on top of regular capital gains tax for higher-income taxpayers. It was enacted to help fund the Affordable Care Act and applies to net investment income — which includes capital gains, dividends, interest, rental income, and royalties — once your modified adjusted gross income (MAGI) exceeds a threshold. For 2025 the thresholds are $200,000 for single and head-of-household filers, $250,000 for married couples filing jointly, and $125,000 for married filing separately. Importantly, the 3.8% applies to the smaller of your net investment income or the amount your MAGI exceeds the threshold, so a taxpayer just over the line pays it on only a sliver of income. The NIIT applies to both short-term and long-term gains, effectively raising the top long-term rate to 23.8% and the top short-term rate to 40.8% for the highest earners. This calculator automatically adds the NIIT when your income plus the gain pushes you over the threshold, so the tax figure you see reflects the true federal cost.

How are home sale gains taxed?

Selling your primary residence enjoys one of the most generous breaks in the tax code: the Section 121 exclusion. If you owned and lived in the home as your main residence for at least two of the five years before the sale, you can exclude up to $250,000 of gain from tax if you're single, or up to $500,000 if you're married filing jointly. Only the gain above that exclusion is taxable, and it is treated as a long-term capital gain. For example, a couple who bought for $300,000 and sells for $750,000 has a $450,000 gain — entirely tax-free because it's under their $500,000 exclusion. You can generally use this exclusion once every two years. Gains beyond the exclusion, sales of second homes or rental properties, and any depreciation you claimed on a rental (which is recaptured at up to 25%) do not qualify and are fully taxable. Keep records of capital improvements — a new roof, kitchen remodel, or addition — because they raise your cost basis and shrink the taxable gain. This calculator models investment gains; for a home sale, subtract your exclusion from the gain before entering it.

What is tax-loss harvesting?

Tax-loss harvesting is the practice of intentionally selling investments that have dropped below their purchase price to realize a capital loss, which then offsets capital gains elsewhere in your portfolio and reduces your tax bill. Losses first offset gains of the same type — short-term losses against short-term gains, long-term against long-term — and any excess can offset the other type. If your losses exceed all your gains, you can deduct up to $3,000 of the remaining loss against ordinary income each year, and carry forward any unused loss indefinitely to future years. For a high earner, harvesting a $10,000 loss to cancel a $10,000 short-term gain can save $3,000 or more in tax. The strategy is most valuable late in the year when you can see your realized gains, and in volatile markets when paper losses are common. The key constraint is the wash-sale rule (see the next question): to keep the loss, you cannot rebuy the same or a substantially identical security within 30 days. A common workaround is to buy a similar-but-not-identical fund to stay invested while preserving the tax loss.

What is the wash-sale rule?

The wash-sale rule prevents investors from claiming a tax loss while effectively staying in the same position. Under the rule, if you sell a security at a loss and buy the same or a 'substantially identical' security within 30 days before or after the sale — a 61-day window in total — the IRS disallows the loss for that year. Instead, the disallowed loss is added to the cost basis of the replacement shares, so you eventually get the benefit when you sell those, but not immediately. The rule also catches purchases in your IRA or your spouse's account, and reinvested dividends can inadvertently trigger it. It applies only to losses, not gains, which is why tax-gain harvesting in the 0% bracket is unaffected. To harvest a loss safely, investors typically wait 31 days before rebuying, or immediately buy a similar fund that tracks the same market but isn't substantially identical — for instance, swapping one broad S&P 500 fund for a total-market fund. Crypto has historically not been subject to the wash-sale rule because it's treated as property rather than a security, though proposals to change this appear regularly.

How are crypto and stock gains taxed?

For federal tax purposes, the IRS treats cryptocurrency as property, so it follows the same capital gains rules as stocks. Every time you sell crypto for dollars, trade one coin for another, or use it to buy goods or services, you trigger a taxable event and must calculate the gain or loss as proceeds minus cost basis. Hold for a year or less and it's a short-term gain taxed at ordinary rates; hold longer and it qualifies for the lower long-term rates of 0%, 15%, or 20%. Stocks work identically, with the added wrinkle that qualified dividends are also taxed at long-term rates. The big practical difference is record-keeping: crypto exchanges historically reported less to the IRS than brokerages, so the burden of tracking basis across wallets and trades falls on you, though new broker reporting rules are tightening this. Both crypto and stock gains can be offset by capital losses and both are subject to the 3.8% NIIT for high earners. One historical quirk is that the wash-sale rule has not applied to crypto, allowing loss harvesting without the 30-day wait — but always confirm current law. This calculator handles either: just enter your cost basis, sale price, and holding period.
US Capital Gains Tax Calculator User Reviews

Disclaimer: Results are estimates for planning only and do not constitute tax, legal, lending, or investment advice. Actual paycheck and tax outcomes can vary based on employer settings, local rules, and personal elections. Consult a qualified US tax professional, CFP, or attorney before making financial decisions.