Capital Gains Tax Calculator.
Estimate the Tax Before You Sell.
Enter the shares you are selling, what you paid, the sale price, how long you held them and your combined tax rate. The calculator returns the gain or loss, the tax owed and what you keep. The sections below explain the federal rates and list 2026 state rates so you can choose the right rate.
Capital Gains Inputs
Enter your investment details and tax information
Tax Calculation Results
Your capital gains tax breakdown
Enter your investment details to calculate capital gains tax
How Capital Gains Tax Works
Capital gains tax applies to the profit you make when you sell an investment for more than its cost basis. The federal rate depends on how long you held the investment:
Long-Term Capital Gains (LTCG)
- Asset held for more than 1 year
- Federal rates: 0%, 15% or 20%
- Tax year 2025: 0% up to $48,350 of taxable income (single) or $96,700 (married filing jointly)
- 15% between those limits and $533,400 (single) or $600,050 (married filing jointly)
- 20% above those amounts; the limits rise with inflation each year
Short-Term Capital Gains (STCG)
- Asset held for 1 year or less
- Taxed as ordinary income at 10% to 37%
- Day-trading gains are almost always short-term
- At the same income, usually a higher rate than long-term
On top of either rate, the 3.8% net investment income tax applies to gains once modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). Rate thresholds above are from IRS Topic 409 for tax year 2025.
Capital Gains Tax Formula
Capital Gain = (Selling Price − Purchase Price) × SharesTax = Capital Gain × Your Tax RateYour cost basis is normally what you paid plus commissions and fees. The calculator takes a per-share purchase price, so to include fees, add them per share: a $10 commission on 100 shares adds $0.10 to each share's cost.
Worked Example: Same Sale, Two Holding Periods
You bought 100 shares at $50 and sell them at $75. You live in a state with a flat 5% income tax.
- Capital gain = ($75 − $50) × 100 = $2,500; sale value = $7,500
- Long-term, 15% federal + 5% state = 20%: tax = $2,500 × 20% = $500; net proceeds = $7,500 − $500 = $7,000
- Short-term, 24% federal bracket + 5% state = 29%: tax = $2,500 × 29% = $725; net proceeds = $6,775
Waiting until the shares have been held for more than a year saves $225 here. The calculator also reports an effective rate of tax ÷ sale value: $500 ÷ $7,500 = 6.67% in the long-term case. That is a share of the money you receive, not your tax rate on the gain.
State Tax on Capital Gains (2026 Top Rates)
Most states tax capital gains as ordinary income, on top of federal tax. The figure shown is the top marginal rate; your own rate depends on your income. Add your state rate to your federal rate when you fill in the calculator.
Ordinary income; no lower long-term rate
NYC residents add up to 3.876%
Taxed as ordinary income
Taxed as ordinary income
Taxed as ordinary income
Long-term gains; short-term gains 8.5%; 4% surtax on income over $1,083,150
Flat rate
Flat rate
Flat rate
Flat rate
Flat rate; counties add local income tax
Flat rate on nonbusiness income over $26,050
Flat rate
Capital gains exempt from state income tax
Tax on long-term gains only, above $278,000; higher rate above $1 million
No personal income tax
No personal income tax
No personal income tax
Top marginal rates for tax year 2026 as published by the Tax Foundation (February 2026). Local taxes and surtaxes vary; check your state revenue department or a tax professional for your situation.
How to Reduce Capital Gains Tax
Tax-Loss Harvesting
Sell losing positions to offset gains. Net losses beyond your gains can offset up to $3,000 of ordinary income a year, and the rest carries forward to later years. The wash-sale rule disallows the loss if you buy back a substantially identical security within 30 days.
Hold Over 1 Year (LTCG)
Holding an asset for more than a year moves the gain from ordinary income rates (up to 37%) to the 0%, 15% or 20% long-term rates. In the worked example above, that saves $225 on a $2,500 gain.
Use Tax-Advantaged Accounts
Selling inside an IRA or 401(k) does not trigger capital gains tax. Qualified Roth withdrawals are tax-free; withdrawals from traditional accounts are taxed as ordinary income.
Gift or Donate Appreciated Assets
Donating shares held more than a year to a qualified charity generally avoids tax on the gain, and if you itemize you can usually deduct their fair market value, subject to income limits. Shares gifted to family keep your cost basis, so the gain is taxed at the recipient's rate when they sell; kiddie-tax rules can apply the parent's rate to a child.
Offset with Capital Losses
Long-term losses offset long-term gains first and short-term losses offset short-term gains first. A net loss left in one category then offsets net gains in the other.
Frequently Asked Questions
What is the capital gains tax rate in California?▾
California taxes capital gains as ordinary income, with no lower rate for long-term gains. Its top rate is 13.3%, which applies to taxable income over $1 million. Stacked with the 20% top federal long-term rate and the 3.8% net investment income tax, the top combined rate on a long-term gain is 37.1%. That is the highest statewide figure, but New York City residents can face a higher combined rate once the city tax is added.
Does Florida have a capital gains tax?▾
No. Florida has no personal income tax, so it does not tax capital gains. Florida residents pay only federal tax: 0%, 15% or 20% on long-term gains, ordinary income rates on short-term gains, and the 3.8% net investment income tax if their income is above the threshold.
What is the capital gains tax in Texas?▾
Texas has no personal income tax, so there is no state tax on capital gains. Texas residents pay only the federal rates: 0%, 15% or 20% on long-term gains, ordinary income rates on short-term gains, plus the 3.8% net investment income tax above the income threshold.
How much is capital gains tax in New York?▾
New York taxes capital gains as ordinary income, with a top state rate of 10.9%. New York City residents also pay city income tax of up to 3.876%. Stacking the top rates (20% federal long-term, 3.8% net investment income tax, 10.9% state and 3.876% city) gives about 38.6% on long-term gains. With the 37% federal ordinary rate in place of the 20%, short-term gains reach about 55.6%. These are top marginal rates; most people pay less.
Why are capital losses limited to $3,000?▾
The IRS lets you deduct net capital losses against ordinary income only up to $3,000 a year ($1,500 if married filing separately). Losses above that carry forward to later years, where they first offset capital gains and then up to $3,000 of ordinary income each year.
Can long-term capital losses offset short-term gains?▾
Yes, but in a specific order. First, long-term losses offset long-term gains and short-term losses offset short-term gains. If one category still has a net loss, it then offsets net gains in the other category. The netting is done on Form 8949 and Schedule D of your federal return.
What is tax-loss harvesting?▾
Tax-loss harvesting is selling investments at a loss to offset gains on profitable sales. If you have a $10,000 gain from selling Stock A, selling Stock B at a $10,000 loss brings your net gain to zero. Watch the wash-sale rule: if you buy a substantially identical security within 30 days before or after the loss sale, the loss is disallowed for now and added to the cost basis of the new shares.
What is the capital gains tax on real estate?▾
If you sell your main home, you can exclude up to $250,000 of gain ($500,000 for married filing jointly) if you owned it and lived in it for at least 2 of the 5 years before the sale. Gain above the exclusion is taxed at long-term rates if you owned the home for more than a year. Rental property does not get this exclusion, and the part of the gain that comes from depreciation you claimed (unrecaptured section 1250 gain) is taxed at up to 25%.
Why doesn't the calculator ask for my state?▾
Because the rate that applies to you depends on your income, filing status and state, the calculator takes one combined rate instead of guessing. Add your federal rate, your state rate and, if it applies, the 3.8% net investment income tax, and enter the total. The state table on this page lists 2026 top rates as a starting point.
Method and sources
Capital gain = (selling price − purchase price) × shares. Tax = gain × the single rate you enter (zero when the result is a loss); net proceeds = sale value − tax; the effective rate shown is tax ÷ sale value. The calculator does not apply brackets, the net investment income tax or loss deductions itself, so build those into the rate you enter.
- Topic no. 409, Capital gains and losses — Internal Revenue Service
- Publication 550, Investment Income and Expenses — Internal Revenue Service
- Topic no. 559, Net investment income tax — Internal Revenue Service
- State Individual Income Tax Rates and Brackets, 2026 — Tax Foundation
Written by Utkarsh Mohan. Last reviewed . Results are estimates for education, not financial or tax advice.
Guides that explain this calculator
- Tax-Loss Harvesting: Turn Losses into SavingsConverting a loss into a deduction without tripping the wash sale rule.
- Tax Implications of Averaging Down Stocks: What Every Investor Must KnowWash sales, cost basis methods and tax lots before you add shares.
- Roth IRA vs Traditional IRA: Which is Better?The tax-timing decision and what actually decides it.
- Portfolio Rebalancing: The Art of Selling WinnersKeeping risk where you set it, and the tax cost of doing so.