Free to Use

📊 Capital Gains Tax Calculator

Calculate capital gains tax owed for short-term and long-term holdings based on US federal tax brackets including the Net Investment Income Tax (NIIT). See your effective tax rate, total gain, and net proceeds after taxes.

Your ordinary income before capital gains
Optional: Select a state to include state capital gains tax
Total Gain
-
Sale price minus purchase price
Federal Tax Owed
-
Federal capital gains tax
NIIT (3.8%)
-
Net Investment Income Tax
Effective Tax Rate
-
Average tax rate on gain
State Tax
-
State capital gains tax
Net Proceeds
-
After all taxes
Calculation completed successfully!
Please enter valid amounts.

📊 2025 Capital Gains Tax Brackets

Long-term capital gains (assets held for more than one year) are taxed at preferential rates. Short-term gains are taxed as ordinary income. The Net Investment Income Tax (NIIT) of 3.8% applies above certain income thresholds.

Long-Term Capital Gains Rates — Single
Tax RateTaxable Income Range
0%$0 – $48,350
15%$48,351 – $533,400
20%$533,401+

Plus 3.8% NIIT on the lesser of net investment income or MAGI over $200,000.

Long-Term Capital Gains Rates — Married Filing Jointly
Tax RateTaxable Income Range
0%$0 – $96,700
15%$96,701 – $600,050
20%$600,051+

Plus 3.8% NIIT on the lesser of net investment income or MAGI over $250,000.

Long-Term Capital Gains Rates — Head of Household
Tax RateTaxable Income Range
0%$0 – $64,750
15%$64,751 – $566,700
20%$566,701+

Plus 3.8% NIIT on the lesser of net investment income or MAGI over $200,000.

Long-Term Capital Gains Rates — Married Filing Separately
Tax RateTaxable Income Range
0%$0 – $48,350
15%$48,351 – $300,000
20%$300,001+

Plus 3.8% NIIT on the lesser of net investment income or MAGI over $125,000.

Short-Term Capital Gains

Short-term capital gains (assets held for one year or less) are taxed as ordinary income at your regular income tax rates (10% to 37%). See our Income Tax Calculator for the full ordinary income tax brackets.

Net Investment Income Tax (NIIT) Thresholds
Filing StatusMAGI Threshold
Single$200,000
Head of Household$200,000
Married Filing Jointly$250,000
Married Filing Separately$125,000

NIIT = 3.8% × min(net investment income, MAGI − threshold). MAGI = modified adjusted gross income (annual income + capital gain in this calculator).

Note: These brackets are for the 2025 tax year. Tax rates and brackets may be adjusted annually for inflation.

📖 Capital Gains Tax Guide

📌 Short-Term vs Long-Term

Short-term: Assets held ≤ 1 year. Taxed at ordinary income rates (10%–37%).

Long-term: Assets held > 1 year. Taxed at preferential rates (0%, 15%, or 20%).

Holding assets longer can significantly reduce your tax burden.

📋 What Is a Capital Gain?

A capital gain is the profit you earn when you sell an asset for more than you paid for it. The formula is:

Capital Gain = Sale Price − Purchase Price − Cost Basis Adjustments

Assets include stocks, bonds, real estate, cryptocurrency, collectibles, and other investments.

💰 Net Investment Income Tax (NIIT)

The NIIT is an additional 3.8% tax that applies to the lesser of your net investment income or the amount by which your modified adjusted gross income (MAGI) exceeds a threshold based on your filing status.

This tax applies even to long-term capital gains that otherwise qualify for the 0% or 15% rates.

🔍 Capital Losses

Capital losses can offset capital gains, reducing your tax liability. If your losses exceed your gains, you can deduct up to $3,000 ($1,500 if married filing separately) against ordinary income each year.

Unused losses carry forward to future tax years indefinitely.

How Capital Gains Tax Is Calculated

The calculation depends on the holding period:

1 Calculate your gain: Sale Price − Purchase Price = Total Gain
2 Determine holding period: If held > 1 year, it's long-term (preferential rates). If ≤ 1 year, it's short-term (ordinary rates).
3 For short-term: Add the gain to your ordinary income and calculate tax using regular income tax brackets (10%–37%).
4 For long-term: Determine the capital gains rate (0%, 15%, or 20%) based on your total taxable income (ordinary income + capital gain) and filing status.
5 Add NIIT (if applicable): If your MAGI exceeds the threshold, add 3.8% on the lesser of your gain or excess MAGI.
6 Add state tax (if applicable): Apply your state's capital gains tax rate.

Important: The tax rate applied to your long-term capital gains depends on your total taxable income — including the gain itself. A large gain can push you into a higher capital gains bracket.

💡 Capital Gains Tax Planning Tips

📅 Hold for More Than One Year

The single most effective way to reduce capital gains taxes is to hold assets for more than one year. Long-term gains are taxed at 0%, 15%, or 20% — much lower than ordinary income rates (up to 37%).

📉 Tax-Loss Harvesting

Sell underperforming investments to realize losses that offset your gains. This strategy, known as tax-loss harvesting, can reduce or eliminate your capital gains tax liability. Be mindful of wash-sale rules — you cannot repurchase the same or substantially identical security within 30 days.

🏠 Use Tax-Advantaged Accounts

Invest through tax-advantaged accounts like 401(k)s, IRAs, and HSAs to defer or avoid capital gains taxes entirely. Within these accounts, you can trade freely without triggering capital gains taxes. Only withdrawals may be taxable.

🎁 Gift Appreciated Assets

Instead of selling appreciated assets and paying tax, consider donating them to charity or gifting them to family members in lower tax brackets. Charitable donations of appreciated assets can provide a deduction for the full fair market value while avoiding capital gains tax.

⚖️ Time Your Sales

If you're nearing retirement or expect a lower-income year, consider deferring asset sales until your income drops. A lower total income could qualify you for the 0% long-term capital gains rate, saving you thousands in taxes.

🏡 Primary Residence Exclusion

If you sell your primary residence, you may exclude up to $250,000 of gain ($500,000 for married couples filing jointly) from capital gains tax if you've lived in the home for at least 2 of the last 5 years.

Common Capital Gains Tax Mistakes to Avoid
  • Forgetting about NIIT: High-income earners often forget the 3.8% Net Investment Income Tax, which can add significantly to the tax bill.
  • Ignoring state taxes: Some states tax capital gains as ordinary income at rates up to 13.3% (California). Factor this into your sale decisions.
  • Selling too soon: Selling just before the one-year holding period costs you the difference between ordinary rates (up to 37%) and long-term rates (0-20%). Check your holding period.
  • Wash sale violations: Repurchasing a substantially identical security within 30 days of a loss sale disallows the loss for tax purposes.
  • Not adjusting cost basis: Remember to include commissions, improvements (for real estate), and other costs that increase your basis and reduce your gain.
  • Overlooking the 0% bracket: If your total taxable income is below $48,350 (single), your long-term capital gains rate could be 0% — take advantage of this!

📊 Capital Gains Tax Calculator Features

📈
Short & Long-Term
Calculate tax for both short-term (ordinary rates) and long-term (preferential 0%/15%/20% rates) holdings with correct bracket application.
🏛️
All Filing Statuses
Supports Single, Married Filing Jointly, Married Filing Separately, and Head of Household with correct capital gains brackets for each.
💰
NIIT Included
Automatically calculates the 3.8% Net Investment Income Tax when your MAGI exceeds the threshold for your filing status.
🗺️
State Tax Estimates
Select from all 50 states with appropriate state tax rates applied to your capital gains for a more complete picture.
📊
Rate Breakdown
See your effective tax rate on capital gains, along with a detailed breakdown of federal tax, NIIT, and state tax components.
🔒
Privacy Protected
All calculations are performed locally in your browser. Your financial information never leaves your device.

Understanding Capital Gains Tax

What Is a Capital Gain?

A capital gain is the profit realized when you sell a capital asset (such as stocks, bonds, real estate, cryptocurrency, or collectibles) for more than its purchase price (cost basis). The difference between the sale price and the purchase price is your capital gain — and that gain may be subject to taxation.

Capital gains are classified as either short-term (assets held for one year or less) or long-term (assets held for more than one year). This distinction is crucial because the tax treatment differs dramatically between the two classifications.

Short-Term vs Long-Term Capital Gains

Short-term capital gains are taxed at your ordinary income tax rates, which range from 10% to 37% depending on your income level and filing status. If you're in the 24% tax bracket, your short-term capital gains are taxed at 24% — the same rate as your wages and salary.

Long-term capital gains benefit from preferential tax rates of 0%, 15%, or 20%, which are significantly lower than ordinary income rates. The rate you pay depends on your total taxable income (including the gain) and your filing status. For example, a single filer with a total taxable income under $48,350 pays 0% on long-term gains — meaning many middle-income investors could pay no federal tax on their investment profits.

The Net Investment Income Tax (NIIT)

The Affordable Care Act introduced the 3.8% Net Investment Income Tax, which applies to higher-income individuals. If your modified adjusted gross income (MAGI) exceeds $200,000 (single or head of household), $250,000 (married filing jointly), or $125,000 (married filing separately), you may be subject to this additional tax on the lesser of your net investment income or the excess MAGI amount.

The NIIT applies on top of your regular capital gains tax. For example, a high-income earner in the 20% long-term capital gains bracket would actually pay 23.8% (20% + 3.8% NIIT) on their investment income.

State Capital Gains Taxes

In addition to federal taxes, most states also tax capital gains. Some states treat capital gains as ordinary income (with progressive rates up to 13.3% in California), while others have flat tax rates. Nine states have no income tax at all: Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming. Incorporate state taxes into your planning to get a complete picture of your tax liability.

Tax Planning Strategies

Effective capital gains tax planning can significantly reduce your tax burden:

Frequently Asked Questions (FAQ)

What is the difference between short-term and long-term capital gains?
Short-term capital gains are profits from selling assets held for one year or less. These are taxed at your ordinary income tax rates (10%–37%). Long-term capital gains are profits from selling assets held for more than one year. These are taxed at preferential rates of 0%, 15%, or 20%, depending on your total taxable income and filing status. The holding period is measured from the date you acquired the asset to the date you sold it.
How do I know if I qualify for the 0% capital gains rate?
For the 2025 tax year, single filers with total taxable income (including capital gains) up to $48,350 qualify for the 0% long-term capital gains rate. For married couples filing jointly, the threshold is $96,700. Head of household filers qualify up to $64,750. This means many middle-income investors can realize significant capital gains without paying any federal tax, as long as their total income stays within these limits.
What is the Net Investment Income Tax (NIIT)?
The NIIT is an additional 3.8% tax on net investment income that applies to high-income taxpayers. It applies to the lesser of your net investment income or the amount by which your modified adjusted gross income (MAGI) exceeds $200,000 (single/head of household), $250,000 (married filing jointly), or $125,000 (married filing separately). Net investment income includes capital gains, interest, dividends, rental income, and other passive income. The NIIT applies on top of your regular capital gains tax.
Do I pay capital gains tax when I sell my primary residence?
You may be able to exclude up to $250,000 of gain ($500,000 for married couples filing jointly) from capital gains tax when you sell your primary residence. To qualify, you must have owned and lived in the home as your primary residence for at least 2 of the 5 years before the sale (the "2-out-of-5-year rule"). This exclusion can be used once every two years. Gains exceeding these limits are taxable as long-term capital gains.
Can capital losses offset capital gains?
Yes, capital losses can fully offset capital gains in the same tax year. If your losses exceed your gains, you can deduct up to $3,000 ($1,500 if married filing separately) of the net loss against your ordinary income. Any remaining unused losses can be carried forward to future tax years indefinitely. This strategy, known as tax-loss harvesting, is a powerful way to reduce your tax liability. Be careful of wash-sale rules — you cannot claim a loss if you repurchase the same or substantially identical security within 30 days.
How is cryptocurrency taxed?
The IRS treats cryptocurrency as property for tax purposes, not currency. This means cryptocurrency transactions are subject to capital gains tax just like stocks and real estate. If you hold crypto for more than one year before selling, you qualify for long-term capital gains rates (0%, 15%, or 20%). If you hold for one year or less, gains are taxed as ordinary income. Every crypto transaction — including trading one cryptocurrency for another, using crypto to purchase goods, or converting crypto to fiat currency — is a taxable event.
What is cost basis and how does it affect my taxes?
Cost basis is the original value of an asset for tax purposes, usually the purchase price plus any commissions, fees, and improvements. When you sell an asset, your capital gain is calculated as: Sale Price − Cost Basis. A higher cost basis means a lower gain and less tax. For stocks, you may need to track cost basis per share, especially if you bought shares at different times. For real estate, improvements like renovations and additions increase your cost basis, reducing your taxable gain.
Do I have to pay state taxes on capital gains?
Most states tax capital gains as ordinary income, meaning they're included in your state taxable income and taxed at your state's rate. Nine states have no income tax: Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming. Some states have special treatment for capital gains — for example, New Hampshire only taxes interest and dividends, not capital gains from asset sales. State tax rates vary widely, from 0% to 13.3% (California's top rate).
What happens if I forget to report capital gains?
The IRS requires brokers to report cost basis and sale proceeds on Form 1099-B, which is also sent to the IRS. If you fail to report capital gains, the IRS will likely catch the discrepancy through its automated matching system. Penalties for underreporting can include accuracy-related penalties (20% of the underpayment), plus interest on unpaid taxes. In severe cases of intentional omission, penalties and even criminal charges may apply. Always report all capital gains — if you're unsure about the rules, consult a tax professional.
Can I use the capital gains calculator for tax filing?
This Capital Gains Tax Calculator provides estimates for informational and educational purposes. It is designed to help you understand potential tax liability and plan your investment strategy. While it uses current tax brackets and NIIT rules, it does not account for every tax situation, including alternative minimum tax (AMT), special collections rates, state-specific nuances, or recent legislative changes. For actual tax filing, use official IRS forms (Schedule D and Form 8949) or consult a qualified tax professional.

About This Capital Gains Tax Calculator

Our Capital Gains Tax Calculator helps you estimate the federal and state taxes owed on your investment gains. Whether you're planning to sell stocks, real estate, cryptocurrency, or other assets, this tool provides a clear, instant estimate of your tax liability based on current US tax laws.

Why Choose Our Capital Gains Tax Calculator?

📊 Current Tax Rules

Uses 2025 capital gains tax brackets including 0%, 15%, and 20% long-term rates, ordinary income rates for short-term gains, and the 3.8% NIIT.

🗺️ All 50 States

Includes state tax rates for every state, from no-tax states to high-tax states, applied to your capital gains for a complete estimate.

📈 Short & Long-Term

Handles both holding periods correctly — short-term gains taxed at ordinary rates, long-term gains at preferential capital gains rates.

💰 NIIT Calculation

Automatically applies the 3.8% Net Investment Income Tax when your MAGI exceeds the appropriate threshold for your filing status.

🔒 Privacy First

All calculations are performed in your browser. No personal or financial information is stored, transmitted, or shared with any third parties.

🆓 Always Free

Complete access to all features with no registration, no hidden fees, and no usage limits. Use it as often as you need.

Important Disclaimer: This Capital Gains Tax Calculator provides estimates for informational and educational purposes only. Tax laws are complex and subject to change. This calculator does not account for all tax situations, including AMT, collectibles rates (28%), qualified small business stock, wash sale adjustments, or other special circumstances. For personalized tax advice, please consult a qualified tax professional, CPA, or tax attorney. Always verify your tax calculations with official IRS resources (Schedule D, Form 8949) or a licensed tax preparer.