Skip to main content

Capital Gains Tax Calculator (USA)

Use GlobalCalqulate’s free Capital Gains Tax Calculator (USA, 2026) to estimate taxes on profits from selling stocks, ETFs, crypto, and real estate. Compare short-term vs long-term capital gains tax, enter purchase price (cost basis), sale price, holding period, and income level to estimate tax owed and after-tax profit. Helpful for investment planning, tax-loss harvesting decisions, and smarter sell timing.

United StatesLast revised Maintained by Pavan Kusunuri · About our editorial standards

Calculator inputs

Purchase & Sale Details

Holding Period

Taxpayer Profile

Capital Losses & Offsets

State Taxes

Net Investment Income Tax (NIIT)

Your results

Total Capital Gains Tax
$5,700.00
Long-Term Capital Gain
Net Capital Gain
$28,500.00
Federal Tax
$4,275.00
Federal Rate Applied
15% long-term rate
State Tax
$1,425.00
NIIT (3.8%)
$0.00
After-Tax Profit
$22,800.00
Effective Rate on Gain
20.0%
How this estimate was calculated
  • Enter your taxable income BEFORE this gain. The gain is stacked on top of it, which is how the 0% / 15% / 20% bands are measured.
  • Collectibles (up to 28%), section 1250 depreciation recapture (up to 25%) and qualified small business stock follow different rules that this estimate does not model.

Opens your browser's print dialog: choose "Save as PDF", then attach the file to an email. The report carries your inputs, the result and any assumptions and data sources behind it.

Financial Disclaimer: This result is an educational estimate produced by applying published rates and thresholds to the figures you entered. It is not a tax determination: your actual liability depends on circumstances this calculator does not collect. Confirm your position with the relevant tax authority or a qualified accountant before acting on it. Full disclaimer.

Sources & methodology

Rates for:
2026
Figures verified:
— checked against the primary source above
Scheduled re-verification:
December 2026

Calculation type: Rule-based calculation. Uses 2026 rates and thresholds. Figures are taken from Internal Revenue Service and Legal Information Institute, Cornell Law School — see sources below.

Reviewed by Pavan Kusunuri — Founder and software engineer; checks each figure against the issuing authority's published source · Checked

Your entries stay on this device. This calculator runs entirely in your browser — the figures you type are not sent to us or to anyone else. The page itself uses cookies for analytics and advertising, described in the privacy policy.

How to Use This Calculator

  1. Enter purchase and sale price

    Provide what you paid and what you sold the asset for.

  2. Add fees and losses

    Include brokerage fees and capital losses to improve accuracy.

  3. Select holding period

    Choose short-term or long-term based on how long you held the asset.

  4. Enter income and filing status

    Used to determine federal capital gains and NIIT thresholds.

  5. View tax and net profit

    See total tax, NIIT, and after-tax capital gain.

Example: Stock held long-term, single filer

$50,000 purchase + $1,500 fees, sold for $85,000, $120,000 other taxable income, $5,000 in other capital losses, 5% state tax — calculated by this calculator's own engine.

Example Inputs
Purchase Price
$50,000
Sale Price
$85,000
Transaction Fees
$1,500
Holding Period
Long-term
Filing Status
Single
Annual Income (before gain)
$120,000
Other Capital Losses
$5,000
State Tax Rate
5%
Example Results
Net Capital Gain
$28,500
Federal Tax (15% long-term rate)
$4,275
State Tax
$1,425
NIIT
$0
Total Capital Gains Tax
$5,700
After-Tax Profit
$22,800
Generated by this calculator's own engine using the inputs above. NIIT is $0 here because MAGI ($148,500) is below the $200,000 single-filer threshold.

Understanding Your Results

  • Net Capital Gain
    Capital gain after deducting transaction fees and capital losses.
  • Federal Capital Gains Tax
    Tax applied based on holding period and income level.
  • NIIT (3.8%)
    Net Investment Income Tax for higher-income taxpayers.
  • After-Tax Profit
    Amount you keep after all capital gains taxes.

Key Tips

  • Holding investments longer than one year can reduce tax.
  • Capital losses can offset gains and lower taxes.
  • High earners may owe NIIT in addition to capital gains tax.
  • State taxes can significantly affect after-tax returns.

US Capital Gains Tax Calculator – Complete Guide (2026)

Short-Term vs Long-Term Capital Gains

Assets held one year or less are short-term gains, taxed at your ordinary income rate (10% to 37%). Assets held more than one year are long-term gains, taxed at the preferential 0%, 15%, or 20% federal rate instead. Crossing the one-year mark before selling is the single biggest lever most investors have over how much tax they owe on a given sale.

Your Gain Stacks on Top of Your Other Income

The 0%/15%/20% long-term thresholds are measured on your taxable income including the gain, not on the gain alone. That means the gain is layered on top of your other income, and if the combined total crosses a threshold, part of the gain is taxed at one rate and the rest at the next rate up — it is not a single flat rate picked off your total income. This calculator applies that stacking automatically and shows when a gain is split across bands.

Net Investment Income Tax (NIIT)

A 3.8% surtax applies to investment income once modified adjusted gross income exceeds $200,000 (single/head of household), $250,000 (married filing jointly), or $125,000 (married filing separately). It applies to the lesser of your net investment income or the amount your income exceeds the threshold — not to the entire gain — so someone just over the line owes far less than 3.8% of the full sale.

State Capital Gains Tax

Most states tax capital gains as ordinary income alongside federal tax, though a handful (including Texas, Florida, and Washington for most assets) have no state capital gains tax at all. This calculator applies the flat state rate you enter to the net gain; check your own state's current rules since some tax long-term and short-term gains differently.

Reducing Capital Gains Tax

Common strategies include holding an asset past the one-year mark to qualify for long-term rates, harvesting realized losses to offset gains (subject to the $3,000/year limit against ordinary income and the wash-sale rule), and timing large sales across tax years to avoid pushing income into a higher bracket in a single year.

Formula & methodology

Limitations

  • Federal only. State capital gains tax is not included, and several states tax gains as ordinary income.
  • Cost basis is used exactly as entered. Adjustments for reinvested dividends, stock splits, return of capital, inherited step-up and gifted basis are not calculated.
  • Wash-sale rules, carried-forward capital losses and the annual ordinary-income offset for net capital losses are not modelled.
  • Collectibles, qualified small business stock and unrecaptured Section 1250 gain on real estate use special rates this tool does not apply.
  • The Net Investment Income Tax above the statutory thresholds is not separately itemized.
  • The Section 121 primary-residence exclusion is not applied automatically.
  • An estimate for planning. Confirm with a tax professional before relying on it for a sale decision.

This page is educational. It applies published rates and thresholds to the figures you enter and shows the arithmetic behind the result. It is an estimate, not a tax determination: your actual liability depends on circumstances this calculator does not collect, and only the relevant tax authority — or an accountant who can see your full position — can confirm what you owe.

Financial Disclaimer: This calculator estimates federal capital gains tax using the short-term (ordinary income) and long-term (0%/15%/20%) rate brackets, including the 3.8% Net Investment Income Tax where it applies and the IRC §1211(b) annual loss-offset limit. It does not account for wash-sale rules, cost-basis adjustments for reinvested dividends or stock splits, the primary-residence sale exclusion, or special asset rules such as collectibles (up to 28%), Section 1250 depreciation recapture, or qualified small business stock (Section 1202). State rates you enter are approximations, not official schedules. This tool is for planning purposes only and is not tax advice — consult a CPA or tax professional before filing. Full disclaimer.

Understanding Capital Gains Tax

Capital gains tax is owed when you sell an investment (stocks, real estate, crypto) for more than its purchase price. The profit (gain) is classified as either short-term (held 1 year or less, taxed as ordinary income) or long-term (held more than 1 year, taxed at preferential rates). Long-term capital gains rates are typically 0%, 15%, or 20% depending on income level, compared to ordinary income rates up to 37%.

Smart investors use tax strategies like holding investments 1+ years to qualify for long-term rates, harvesting losses to offset gains, and timing sales strategically. Special rules apply to specific assets: primary residences get $250k/$500k exclusions per person, while collectibles face different rates. Understanding your basis (original cost) and holding period is critical for accurate tax calculation.

Capital Gains Tax Formula

Capital Gain = Sale Price - Cost Basis
Tax Owed = Capital Gain x Tax Rate
Long-term Tax: 0% (above $44k single), 15% ($44k-$492k), 20% (above $492k)
Short-term Tax: Same as ordinary income brackets (up to 37%)

Cost basis includes purchase price plus improvements. Long-term rates apply to assets held more than 1 year. Tax brackets change annually; rates above are 2024 approximations.

Key Terms & Definitions

Cost Basis
Original purchase price plus improvements; used to calculate gain
Long-Term Gain
Assets held more than 1 year, taxed at preferential rates (0/15/20%)
Short-Term Gain
Assets held 1 year or less, taxed as ordinary income (up to 37%)
Tax-Loss Harvesting
Selling losing investments to offset capital gains
Wash Sale
Selling at loss then buying same/similar asset within 30 days; disallowed
Adjusted Gross Income (AGI)
Income threshold determining long-term capital gains rate

Capital Gains Tax Strategies

  • Hold investments 1+ years to qualify for long-term rates (0-20% vs. up to 37%)
  • Practice tax-loss harvesting: sell losing investments to offset gains
  • Time large sales across tax years to stay in lower tax brackets
  • Understand basis: track original cost plus any improvements for accurate calculations
  • Avoid wash sales: don't repurchase similar assets within 30 days of loss sales
  • Consider charitable donations of appreciated assets instead of selling to avoid tax

Frequently Asked Questions

Is my long-term capital gains rate based on my total income or just the gain?

Your gain stacks on top of your other taxable income, not the other way around. The 0%/15%/20% thresholds are measured on taxable income including the gain, so if your income plus gain crosses a threshold, part of the gain is taxed at one rate and the rest at the next rate — it is not one flat rate applied to the whole gain. This calculator's federal tax figure reflects that split automatically; the 'Federal Rate Applied' line shows when a gain is split across bands.

How does the holding period affect my tax rate?

Assets held for more than one year qualify for long-term capital gains treatment, which is taxed at preferential rates of 0%, 15%, or 20% depending on income. Assets held one year or less are taxed as short-term gains at ordinary income tax rates, which are typically much higher.

Does this calculator work for real estate sales?

Yes, you can estimate taxes on property sales. Keep in mind that a primary residence may qualify for a $250,000 (single) or $500,000 (married filing jointly) exclusion if you owned and lived in it for at least 2 of the last 5 years — this calculator does not automatically apply that exclusion, so subtract it from your gain manually if it applies.

How do transaction costs affect my taxable gain?

Buying and selling costs, such as brokerage fees or closing costs, can be added to your cost basis or subtracted from your sale price, which reduces the taxable gain. Include these amounts in your purchase or sale price inputs for a more accurate estimate.

Does this calculator include state capital gains taxes?

It focuses primarily on federal capital gains tax, with an optional state tax rate input you can set yourself. State rules vary significantly — some states, like Texas, have no capital gains tax, while others tax gains as ordinary income.

How does the Net Investment Income Tax (NIIT) get calculated here?

If your modified adjusted gross income (income plus the gain) exceeds $200,000 (single/head of household), $250,000 (married filing jointly), or $125,000 (married filing separately), the calculator applies the 3.8% NIIT — but only on the lesser of your net investment income or the amount your MAGI exceeds the threshold, not on the entire gain. That is why someone just over the threshold sees a small NIIT charge rather than 3.8% of the whole sale.

Need more help? Contact support or email globalcalqulate@gmail.com. We typically reply within 24–48 hours.

How this capital gains tax calculator works

The calculator estimates US federal capital gains tax using either the short-term (ordinary income) or long-term (0 %, 15 % or 20 %) rate. It optionally adds the 3.8 % Net Investment Income Tax (NIIT) for high earners introduced under the Affordable Care Act.

  • Classify the gain as short-term (held ≤12 months) or long-term (held >12 months).
  • Apply the applicable 2026 long-term rate based on taxable income and filing status: 0 %, 15 % or 20 %.
  • Add the 3.8 % NIIT if modified AGI exceeds the threshold ($200k single / $250k MFJ).
  • Show the all-in effective rate on the gain and the net after-tax proceeds.

State capital gains taxes and depreciation recapture are not included. Consult a tax professional for investment decisions.