Capital Gains Tax Calculator
Calculate capital gains tax on stocks, real estate, and investments. Short-term vs long-term rates for 2025-2026.
Investment Details
Optional: Enter Dates to Auto-Detect Holding Period
Related Calculators
About This Calculator
How much capital gains tax will you owe when you sell your investments? This Capital Gains Tax Calculator provides a complete breakdown of your tax liability on stocks, real estate, cryptocurrency, and other assets. Whether you are planning to sell stock holdings, considering the tax implications of selling your home, or evaluating a crypto trade, this calculator shows you exactly how much you will owe in federal capital gains taxes.
Understanding capital gains taxes is essential for investment planning. In 2024, the IRS collected over $327 billion in capital gains taxes from American investors. The tax you pay depends critically on two factors: how long you held the asset (short-term vs. long-term) and your total taxable income. Long-term capital gains rates range from 0% to 20%, while short-term gains are taxed at your ordinary income rate of up to 37%.
What makes this calculator different? We account for the Net Investment Income Tax (NIIT) surtax, real estate primary residence exclusions, and show you exactly how your income level affects your capital gains tax bracket. You will see not just the tax owed, but your net proceeds after taxes.
What you will learn:
- Your capital gain or loss amount
- The applicable tax rate (short-term or long-term)
- Whether the 3.8% NIIT surtax applies
- Your total tax owed on the transaction
- Net proceeds after all taxes
- How to qualify for the real estate exclusion
Use this calculator alongside our Income Tax Calculator to understand your complete tax picture, or our Investment Calculator to plan your portfolio growth with taxes in mind.
How to Use the Capital Gains Tax Calculator
- 1**Select your filing status**: Choose from Single, Married Filing Jointly, Married Filing Separately, or Head of Household. Your filing status determines your capital gains tax brackets and the real estate exclusion amount.
- 2**Enter your annual taxable income**: This is your ordinary income BEFORE adding this capital gain. Your total income determines which capital gains bracket applies. Use our [Tax Bracket Calculator](/finance/tax-bracket-calculator) if you need help determining this.
- 3**Choose the asset type**: Select stocks/ETFs, real estate, cryptocurrency, or other assets. Real estate primary residence sales may qualify for special exclusions.
- 4**Enter your cost basis (purchase price)**: This is what you originally paid for the asset, including any fees or commissions at purchase.
- 5**Enter your sale price (proceeds)**: This is what you received (or expect to receive) when selling the asset.
- 6**Select or auto-detect holding period**: Choose short-term (1 year or less) or long-term (more than 1 year). You can also enter purchase and sale dates to auto-calculate.
- 7**For real estate: Check if primary residence exclusion applies**: If selling your home, indicate whether it was your primary residence and you lived there 2+ years to potentially exclude up to $250,000/$500,000 of gains.
- 8**Review your results**: See your capital gain, tax rate, total tax owed, and net proceeds after taxes.
Short-Term vs. Long-Term Capital Gains: Why Holding Period Matters
The difference between short-term and long-term capital gains can mean paying 0% or 37% on the same profit. Understanding this distinction is one of the most important tax planning concepts for investors.
Short-Term Capital Gains (Held 1 Year or Less): Short-term gains are taxed as ordinary income at your marginal tax rate. In 2025-2026, this means rates from 10% to 37% depending on your income.
| Filing Status | Top Short-Term Rate Kicks In At |
|---|---|
| Single | $640,600+ |
| Married Filing Jointly | $768,600+ |
| Head of Household | $640,600+ |
Long-Term Capital Gains (Held More Than 1 Year): Long-term gains receive preferential tax treatment with only three possible rates: 0%, 15%, or 20%.
| Filing Status | 0% Rate | 15% Rate | 20% Rate |
|---|---|---|---|
| Single | $0 - $48,350 | $48,351 - $533,400 | $533,400+ |
| Married Filing Jointly | $0 - $96,700 | $96,701 - $600,050 | $600,050+ |
| Head of Household | $0 - $64,750 | $64,751 - $566,700 | $566,700+ |
Real Example - $50,000 Gain:
| Holding Period | Tax Rate | Tax Owed | Savings |
|---|---|---|---|
| Short-term (22% bracket) | 22% | $11,000 | - |
| Long-term (15% rate) | 15% | $7,500 | $3,500 |
The "One Day Rule": The IRS counts the day after purchase as Day 1. To qualify for long-term treatment, you must hold an asset for more than 365 days. Selling on the 365th day results in short-term treatment; waiting one more day makes it long-term.
Pro Tip: If you are approaching the one-year mark on a profitable investment, consider whether waiting a few more days or weeks could save you thousands in taxes.
2025-2026 Capital Gains Tax Brackets Explained
Capital gains tax brackets depend on your total taxable income, not just the gain itself. This is a common point of confusion - your capital gains are "stacked" on top of your ordinary income to determine the applicable rate.
How the Stacking Works:
If you are single with $40,000 in ordinary income and realize a $30,000 long-term capital gain:
- Your ordinary income ($40,000) fills the 0% bracket up to $48,350
- The first $8,350 of your gain is taxed at 0%
- The remaining $21,650 is taxed at 15%
- Total tax: $0 + $3,248 = $3,248 (effective rate: 10.8%)
2025-2026 Long-Term Capital Gains Brackets:
Single Filers:
| Taxable Income | Rate |
|---|---|
| $0 - $48,350 | 0% |
| $48,351 - $533,400 | 15% |
| Over $533,400 | 20% |
Married Filing Jointly:
| Taxable Income | Rate |
|---|---|
| $0 - $96,700 | 0% |
| $96,701 - $600,050 | 15% |
| Over $600,050 | 20% |
Head of Household:
| Taxable Income | Rate |
|---|---|
| $0 - $64,750 | 0% |
| $64,751 - $566,700 | 15% |
| Over $566,700 | 20% |
The 0% Bracket Opportunity: Many investors in lower tax brackets can realize capital gains completely tax-free. A married couple with $80,000 in ordinary income could realize up to $16,700 in long-term capital gains at 0% tax.
Planning Tip: In years with lower income (job transition, early retirement, sabbatical), consider harvesting gains while you qualify for the 0% rate.
Real Estate Capital Gains: The $250,000/$500,000 Exclusion
Selling your home can be one of the most tax-advantaged events in your financial life. The primary residence exclusion allows you to exclude up to $250,000 (single) or $500,000 (married filing jointly) of capital gains from taxes entirely.
Qualification Requirements:
- Ownership Test: You must have owned the home for at least 2 of the last 5 years before sale.
- Use Test: You must have lived in the home as your primary residence for at least 2 of the last 5 years.
- Frequency: You can only use this exclusion once every 2 years.
Exclusion Amounts:
| Filing Status | Maximum Exclusion |
|---|---|
| Single | $250,000 |
| Married Filing Jointly | $500,000 |
| Married Filing Separately | $250,000 |
Example - Married Couple Selling Home:
- Purchase price: $300,000
- Improvements made: $50,000
- Cost basis: $350,000
- Sale price: $800,000
- Capital gain: $450,000
- Exclusion applied: $450,000
- Taxable gain: $0
- Tax owed: $0
Partial Exclusions: If you do not meet the full 2-year requirement due to job relocation, health issues, or unforeseen circumstances, you may qualify for a partial exclusion. The excluded amount is prorated based on time lived in the home.
Important Considerations:
- Cost basis includes improvements: Add the cost of permanent improvements (not repairs) to your purchase price.
- Depreciation recapture: If you claimed home office deductions with depreciation, that portion is subject to recapture at 25%.
- Rental history: Time rented out does not count toward the use test and may require depreciation recapture.
Investment Property Warning: This exclusion does NOT apply to rental properties or second homes. Consider a 1031 Exchange to defer taxes on investment property sales.
Tax-Loss Harvesting: Turning Losses Into Savings
Tax-loss harvesting is one of the most powerful strategies for reducing your capital gains tax bill. By strategically selling investments at a loss, you can offset gains and reduce your overall tax liability.
How Tax-Loss Harvesting Works:
- Offset gains with losses: Capital losses first offset capital gains of the same type (short-term vs. long-term).
- Cross-type offsets: Excess losses can offset gains of the other type.
- Deduct against income: If losses exceed gains, deduct up to $3,000 ($1,500 if married filing separately) against ordinary income.
- Carry forward: Unused losses carry forward indefinitely.
Example Strategy:
| Transaction | Amount |
|---|---|
| Long-term gain from Stock A | +$15,000 |
| Short-term gain from Stock B | +$5,000 |
| Long-term loss from Stock C | -$12,000 |
| Net long-term gain | $3,000 |
| Net short-term gain | $5,000 |
| Total taxable gain | $8,000 |
Without harvesting the loss, total taxable gains would be $20,000.
The Wash Sale Rule: The IRS prevents you from claiming a loss if you buy "substantially identical" securities within 30 days before or after the sale. Violations disallow the loss deduction.
Strategies to Avoid Wash Sales:
- Wait 31 days before repurchasing
- Buy a similar but not identical investment (e.g., different index fund tracking the same market)
- Purchase in a different account type (but spouse accounts count!)
Year-End Harvesting Checklist:
- Review unrealized losses in taxable accounts
- Calculate realized gains year-to-date
- Identify losses to harvest that offset gains
- Consider harvesting additional $3,000 to offset ordinary income
- Reinvest in similar (not identical) positions
Important: Tax-loss harvesting only works in taxable accounts, not in IRAs or 401(k)s where gains are already tax-deferred.
The Net Investment Income Tax (NIIT): The 3.8% Surtax
High earners face an additional 3.8% tax on investment income that many people overlook. The Net Investment Income Tax (NIIT), also called the Medicare surtax, applies on top of regular capital gains taxes.
NIIT Thresholds:
| Filing Status | NIIT Kicks In At |
|---|---|
| Single | $200,000 MAGI |
| Married Filing Jointly | $250,000 MAGI |
| Married Filing Separately | $125,000 MAGI |
| Head of Household | $200,000 MAGI |
What Counts as Investment Income:
- Capital gains (short-term and long-term)
- Dividends
- Interest (except municipal bonds)
- Rental income
- Royalties
- Passive business income
- Annuity distributions (earnings portion)
What Does NOT Count:
- Wages and self-employment income
- Distributions from retirement accounts (401k, IRA)
- Tax-exempt municipal bond interest
- Life insurance proceeds
- Social Security benefits
How NIIT is Calculated: The 3.8% tax applies to the LESSER of:
- Your net investment income, OR
- The amount your MAGI exceeds the threshold
Example - Single Filer:
- MAGI: $280,000
- Net investment income: $50,000
- Amount over threshold: $80,000
- NIIT applies to: $50,000 (the lesser amount)
- NIIT owed: $50,000 x 3.8% = $1,900
Total Tax on Capital Gains: A high earner in the 20% long-term bracket with NIIT pays 23.8% total federal tax on long-term gains (20% + 3.8%).
Strategies to Minimize NIIT:
- Invest in tax-exempt municipal bonds
- Maximize tax-advantaged retirement contributions
- Consider Roth conversions in lower-income years
- Time large capital gains for years with lower income
- Use charitable giving strategies like donor-advised funds
State Capital Gains Taxes: The Hidden Cost
Your federal capital gains tax is only part of the picture. Most states also tax capital gains, often at the same rates as ordinary income.
States With No Capital Gains Tax: These states do not tax capital gains (or have no income tax):
- Alaska
- Florida
- Nevada
- New Hampshire (wages exempt, dividends/interest taxed)
- South Dakota
- Tennessee
- Texas
- Washington (7% tax on gains over $262,000 as of 2024)
- Wyoming
Highest State Capital Gains Taxes (2025):
| State | Top Rate | Notes |
|---|---|---|
| California | 13.3% | Highest in nation |
| Hawaii | 11.0% | 7.25% for gains on assets held 1+ year |
| New Jersey | 10.75% | Over $1M income |
| Oregon | 9.9% | Over $125,000 |
| Minnesota | 9.85% | Over $193,000 |
| New York | 10.9% | Over $25M; NYC adds 3.876% |
| Vermont | 8.75% | Over $229,500 |
Total Tax Example - California High Earner:
| Tax Component | Rate |
|---|---|
| Federal long-term capital gains | 20.0% |
| NIIT surtax | 3.8% |
| California state tax | 13.3% |
| Total effective rate | 37.1% |
A California resident could pay nearly as much on long-term gains as the top federal ordinary income rate!
State Tax Planning Considerations:
- Residency timing: Some people establish residency in low-tax states before large sales
- Source rules: Some states tax gains on assets with connections to that state regardless of residency
- Installment sales: Spreading gains over multiple years may help with state taxes
- State-specific exclusions: Some states have their own capital gains exclusions or preferential rates
Important: Changing residency solely for tax purposes requires genuine relocation. The IRS and states scrutinize "paper" moves.
Pro Tips
- π‘Hold investments for at least one year and one day to qualify for long-term capital gains rates. The difference between short-term (up to 37%) and long-term (up to 20%) rates can save thousands on large gains.
- π‘Use tax-loss harvesting to offset gains with losses. Review your portfolio before year-end and consider selling underperforming investments to reduce your tax bill.
- π‘Take advantage of the 0% capital gains bracket if your income is low enough. Married couples with under $96,700 in taxable income pay zero federal tax on long-term gains.
- π‘Maximize the primary residence exclusion by ensuring you meet the 2-year ownership and use tests before selling your home. The $250,000/$500,000 exclusion is one of the biggest tax breaks available.
- π‘Consider charitable giving with appreciated stock. Donating stock held over one year lets you deduct the full market value while avoiding capital gains tax entirely.
- π‘Track your cost basis meticulously, including reinvested dividends and stock splits. Accurate basis prevents overpaying taxes by understating your investment in the asset.
- π‘If you are near the NIIT threshold ($200k single/$250k married), consider strategies to keep MAGI below the line, such as maximizing retirement contributions or timing large sales.
- π‘For large gains, consider installment sales to spread income over multiple tax years, potentially keeping you in lower tax brackets each year.
- π‘Plan major asset sales for years when your income is lower. Job transitions, sabbaticals, or early retirement years may be ideal for realizing gains at lower rates.
- π‘Do not forget state taxes. California residents can pay over 37% total on long-term gains. Consider state tax implications when planning large sales.
- π‘Use specific identification when selling partial positions. Choosing which shares to sell (highest cost basis) can minimize your taxable gain.
- π‘Review your investments quarterly for tax-loss harvesting opportunities throughout the year, not just in December when everyone else is doing it.
Frequently Asked Questions
The capital gains tax on stock sales depends on how long you held the shares and your taxable income. Short-term gains (held 1 year or less) are taxed at ordinary income rates from 10% to 37%. Long-term gains (held over 1 year) are taxed at 0%, 15%, or 20% based on your income. For example, a single filer with $60,000 taxable income selling stock for a $10,000 long-term profit would pay 15% or $1,500 in federal tax. High earners may also owe the 3.8% NIIT surtax, and most states add additional tax.

