Capital Gains Tax Calculator: Short-Term & Long-Term
Selling an investment? Estimate short- and long-term capital gains tax, including NIIT and state impact. Enter cost basis and sale price. Check.
Last updated: July 17, 2026
What Capital Gains Tax Actually Is
You bought Tesla stock for $12,000 two years ago. Today it's worth $28,000. If you sell, you owe capital gains tax on that $16,000 profit—not the full $28,000. Capital gains tax only applies to the increase in value between what you paid (your cost basis) and what you received when you sold.
Here's the part most people miss: holding period changes everything. Sell after 365 days and you pay long-term capital gains rates (0%, 15%, or 20%). Sell on day 364 and you pay your ordinary income tax rate—up to 37%. That one-day difference on a $50,000 gain can mean $6,000+ in extra taxes.
This calculator shows you exactly what you'll owe based on your gains, losses, holding periods, and income level—including state taxes and the 3.8% Net Investment Income Tax if you're above the threshold.
How Capital Gains Tax Is Calculated
- The Core Formula:
- Capital Gain = Sale Price − Cost Basis − Selling Costs
- Tax Owed = Capital Gain × Applicable Tax Rate
Cost basis includes your original purchase price plus any commissions or fees paid when buying. For stocks with reinvested dividends, each reinvestment adds to your basis at that price.
2026 Long-Term Capital Gains Rates (tax year 2026, filed in 2027):
- • 0%: Single up to $49,450 | Married filing jointly up to $98,900
- • 15%: Single $49,451–$545,500 | Married filing jointly $98,901–$613,700
- • 20%: Above these thresholds
- • +3.8% NIIT: If MAGI exceeds $200,000 (single) or $250,000 (married filing jointly). These are statutory and have never been indexed, so unlike the brackets above they don't move each year.
Rate thresholds per IRS Rev. Proc. 2025-32, section .03.
Short-term gains (held 1 year or less) are taxed at your ordinary income tax rate—anywhere from 10% to 37% depending on your bracket.
Two Investors, Two Outcomes
Example 1: Sarah Waits One More Day
Sarah bought 200 shares of NVIDIA at $150/share ($30,000 total) on March 1, 2024. By February 28, 2025, they're worth $72,000. She's tempted to sell immediately—but that would be day 365. She waits until March 2, 2025.
- Sarah's Numbers (ordinary taxable income $85,000, Single, California, 2026):
- Capital gain: $72,000 − $30,000 = $42,000
- Federal tax (15% LTCG): $6,300
- California tax (9.3%, 2025 schedule): $3,906
- Total tax: $10,206
- After-tax proceeds: $61,794
Had Sarah sold a day earlier, the gain would have been short-term and taxed as ordinary income, stacked on top of her $85,000. That pushes it across two brackets rather than one flat rate: part at 22%, the rest at 24% once the stack clears $105,700. The bill comes to $9,666 instead of $6,300, so waiting 24 hours saved her $3,366. California, for its part, doesn't care: it taxes capital gains as ordinary income either way. Note her 9.3% is California's 2025 schedule, the most recent we've verified.
Example 2: Marcus Triggers NIIT
Marcus is a software engineer earning $280,000. He sells stock for a $60,000 long-term gain, pushing his MAGI to $340,000.
- Marcus's Numbers (Single, Washington State, 2026):
- Capital gain: $60,000, MAGI $340,000
- Federal LTCG (15%): $9,000
- NIIT: 3.8% × $60,000 = $2,280
- WA capital gains tax: $0
- Total tax: $11,280
- Effective rate on this gain: 18.8%
Two things here surprise people. His rate is 15%, not 20%: the 20% band doesn't start until $545,500 of taxable income for a single filer in 2026, and a $280,000 salary plus a $60,000 gain isn't close. And Washington's capital gains tax doesn't touch him at all, because that tax only applies to gains above a standard deduction, which was $278,000 for 2025 (the Department of Revenue hadn't published the 2026 indexed figure at the time of writing). A $60,000 gain is nowhere near it.
What does bite is the NIIT. It applies to the lesser of your net investment income and the amount your MAGI clears $200,000, so here the whole $60,000 gain is exposed and he pays an extra $2,280. That surtax is the difference between a 15% headline rate and the 18.8% he actually pays.
When to Use This Calculator (and When Not To)
Use It For:
- Pre-sale planning: See how much you'll owe before clicking "sell" in your brokerage account
- Comparing scenarios: Test what happens if you sell now vs. wait for long-term treatment
- Tax-loss harvesting: Enter gains and losses to see the net tax impact
- Year-end planning: Figure out if you should realize gains before December 31 or wait
- NIIT exposure: Check if your sale will push you over the $200K/$250K threshold
Don't Rely on It For:
- Wash sale calculations: We don't track 30-day windows—you need to verify trades manually
- Specific lot identification: We assume you know which shares you're selling and their basis
- Complex basis adjustments: Inherited assets, gifts, stock splits, spinoffs, and mergers require CPA input
- Collectibles: Art, gold, antiques are taxed at 28% max—different from standard LTCG rates
How We Calculate This
We follow IRS netting rules exactly. Short-term gains and losses net against each other first. Long-term gains and losses net separately. If you end up with a net loss in one category and a net gain in the other, they cross-offset. Net losses exceeding gains offset up to $3,000 of ordinary income, with unlimited carryforward. Our Capital Loss Harvesting Helper plans those year-end moves in detail.
What we include: federal capital gains schedules for tax years 2024, 2025, and 2026, all 50 states plus DC, the 3.8% NIIT calculation, qualified dividends (taxed at LTCG rates), and loss carryforward tracking. Pick the year you're filing for: we only offer years we hold a verified federal schedule for, so the year in the selector is always the federal year we compute.
Where the state number is softer: states publish on their own timetables and we only load a schedule once we can verify it against that state's revenue department, so our state brackets currently run 2025 for 22 states and 2024 for the rest. Pick 2026 and the federal half is 2026; the state half is the most recent year we could source. Treat the state line as an estimate and check your state's current schedule before you act on it.
What we don't include: Wash sale detection, depreciation recapture (25% rate for real estate), primary residence exclusion calculations, or AMT. For real estate sales or complex situations, run the numbers here first, then verify with a tax professional.
Capital Gains Tax by State
The federal bill is only half the story. Where you live decides the rest, and it's the half most calculators skip. A $50,000 long-term gain that costs nothing extra in Florida can add several thousand dollars in California, purely on residency. These figures are for the 2026 tax year (the return you file in 2027); state schedules move on their own timetables, so treat the state line as the most recent one we could verify and confirm it before you sell.
Does Florida have a capital gains tax? No. Florida has no individual income tax, so a capital gain isn't taxed at the state level at all. You still owe federal capital gains tax, but the Florida share is zero (Florida Department of Revenue).
Which states have no capital gains tax? Nine states levy no individual income tax, so they don't tax capital gains as income: Alaska, Florida, Nevada, South Dakota, Texas, Wyoming, plus New Hampshire and Tennessee (whose old taxes on interest and dividends have been repealed) and Washington (no income tax, but read the excise-tax caveat below). Everywhere else, the gain is taxed.
How is a capital gain taxed in my state? If your state has an income tax, the usual rule is that it taxes the gain as ordinary income at its regular rates, with no special long-term break. A handful of states are the exception (listed below). Pick your state in the calculator to fold the state share into the estimate.
No state income tax (nine states)
These states don't tax capital gains as income. Two need a footnote, because leaving it off is exactly how a tax page ends up wrong.
| State | Capital gains treatment | Source |
|---|---|---|
| Alaska | No individual income tax, so no state tax on capital gains. | Alaska Department of Revenue |
| Florida | No individual income tax. Florida does not tax capital gains at the state level. | Florida Department of Revenue |
| Nevada | No individual income tax, so no state tax on capital gains. | Nevada Department of Taxation |
| New Hampshire | No tax on wages or capital gains. Its former Interest and Dividends Tax has been fully phased out, so investment gains aren't taxed either. | New Hampshire Department of Revenue Administration |
| South Dakota | No individual income tax, so no state tax on capital gains. | South Dakota Department of Revenue |
| Tennessee | No tax on wages or capital gains. The Hall tax on interest and dividends was fully repealed for tax years starting in 2021. | Tennessee Department of Revenue |
| Texas | No individual income tax. Texas does not tax capital gains at the state level. | Texas Comptroller |
| Washington | No income tax on wages, but a separate 7% excise tax applies to long-term capital gains above an inflation-adjusted standard deduction (about $270,000; $278,000 for 2025), plus an extra 2.9% on gains over $1 million starting in 2025. Most sellers land under the deduction and owe nothing. | Washington Department of Revenue |
| Wyoming | No individual income tax, so no state tax on capital gains. | Wyoming Department of Revenue |
States with a special rule for gains
These have an income tax but break from the ordinary-income default with a lower rate, a deduction, or an exclusion. Every figure here is the state department of revenue's own. A state that isn't on this list taxes the gain at its regular income rates, so check your state's current schedule rather than assume a break exists.
| State | Capital gains treatment | Source |
|---|---|---|
| Arkansas | Excludes 50% of net long-term capital gains from state tax. | Arkansas Department of Finance and Administration |
| Hawaii | Caps the tax on net long-term capital gains at an alternative 7.25% rate. | Hawaii Department of Taxation |
| Massachusetts | Taxes long-term gains at 5% but short-term gains at a higher 8.5%. A 4% surtax applies to income above roughly $1 million. | Massachusetts Department of Revenue |
| New Mexico | Deducts the greater of $1,000 or 40% of net long-term capital gains. | New Mexico Taxation and Revenue Department |
| South Carolina | Allows a 44% deduction on net long-term capital gains. | South Carolina Department of Revenue |
| Wisconsin | Excludes 30% of net long-term capital gains (60% for qualifying farm assets). | Wisconsin Department of Revenue |
Everyone else taxes the gain as ordinary income. California, for one, runs it through the same brackets as your salary, up to 13.3% at the top. New York and Oregon do the same in the high-single-digit to low-double-digit range. If your state isn't called out above, assume the ordinary-income rule and verify the rate with your state's department of revenue before you act on the number.
Related reading
Want the long version? Capital Gains Tax Strategies.
Frequently Asked Questions
What's 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, and are taxed as ordinary income at your marginal tax rate (10% to 37%). Long-term capital gains are from assets held for more than one year, and receive preferential tax rates of 0%, 15%, or 20% depending on your taxable income and filing status. For example, a taxpayer in the 24% bracket pays 24% on short-term gains but only 15% on long-term gains—a significant 9 percentage point difference. The holding period is calculated from the day after purchase to the sale date.
How do the 0%, 15%, and 20% long-term capital gains brackets work?
Long-term capital gains brackets key off your total taxable income, including the gains themselves. For 2026: the 0% rate applies up to $49,450 (single) or $98,900 (married filing jointly). The 15% rate runs from there to $545,500 (single) or $613,700 (married filing jointly). Above those, it's 20%. This is a separate schedule from the ordinary income brackets, and it's indexed for inflation each year. One structural difference worth knowing: ordinary income stacks progressively through every bracket, whereas your long-term gains are generally taxed at the single rate your total income lands in. Per IRS Rev. Proc. 2025-32.
What is NIIT (Net Investment Income Tax) and when does it apply?
The Net Investment Income Tax (NIIT) is a 3.8% surtax on investment income including capital gains, dividends, interest, rental income, and passive business income. It applies when your Modified Adjusted Gross Income (MAGI) exceeds $200,000 (single), $250,000 (married filing jointly), or $125,000 (married filing separately). You pay NIIT on the lesser of: (1) your net investment income, or (2) the amount your MAGI exceeds the threshold. Example: Single filer with $220,000 MAGI and $30,000 capital gains pays NIIT on only $20,000 (the MAGI excess) = $760. The NIIT applies to both short-term and long-term gains and is in addition to regular capital gains tax.
How does the $3,000 capital loss deduction work, and what about carryforwards?
Capital losses first offset capital gains of the same type (short-term losses → short-term gains, long-term losses → long-term gains), then offset the opposite type. After offsetting all gains, you can deduct up to $3,000 ($1,500 if married filing separately) of remaining net capital losses against ordinary income each year. Any losses exceeding $3,000 carry forward indefinitely to future tax years. Example: $50,000 capital loss with no gains. Year 1: deduct $3,000 against ordinary income, carry forward $47,000. Year 2: deduct $3,000, carry forward $44,000. Continue until exhausted. You report carryforward losses on Form 1040 Schedule D. There's no expiration—losses carry forward until used or death.
What are wash-sale rules and how do they affect my taxes?
The wash-sale rule disallows capital loss deductions if you purchase a substantially identical security within 30 days before or after the sale (61-day window total). The disallowed loss isn't permanently lost—it's added to the cost basis of the replacement shares, deferring the tax benefit. Example: Sell 100 shares of Stock A for a $1,000 loss on December 15. Buy 100 shares of Stock A on December 20. The $1,000 loss is disallowed in the current year but increases the basis of the new shares by $1,000. To avoid wash sales: (1) Wait 31+ days before repurchasing the same security, (2) Buy a similar but not identical investment (different company in the same sector, or an index ETF instead of individual stocks), or (3) Use the loss to offset gains without repurchasing. Important: Wash sales also apply if you buy the security in an IRA within 30 days of selling in a taxable account—this permanently disallows the loss.
How are qualified dividends taxed?
Qualified dividends are taxed at the preferential long-term capital gains rates (0%, 15%, or 20%) rather than as ordinary income. To qualify, dividends must be paid by a U.S. corporation or qualified foreign corporation, and you must hold the stock for more than 60 days during the 121-day period beginning 60 days before the ex-dividend date. Most dividends from stocks held in regular brokerage accounts for several months meet these requirements. Non-qualified (ordinary) dividends are taxed at regular income tax rates and include: dividends from REITs, MLPs, and foreign corporations in certain countries, dividends on stocks held less than 61 days, and dividends from tax-exempt organizations. Qualified dividends are also subject to the 3.8% NIIT when MAGI exceeds thresholds.
Do states tax capital gains differently?
Yes, and by a lot. Nine states have no individual income tax, so they don't tax capital gains as income: Alaska, Florida, Nevada, South Dakota, Texas, and Wyoming, plus New Hampshire and Tennessee, whose old taxes on interest and dividends have been repealed. Washington also has no income tax but is the exception: it charges a separate 7% excise tax on long-term gains above an inflation-adjusted standard deduction (about $270,000, so most sellers owe nothing), with an added 2.9% on gains over $1 million starting in 2025. Every other state with an income tax taxes the gain, and most tax it as ordinary income at their regular rates: California up to 13.3%, New York up to 10.9%, Oregon up to 9.9%. A few break from that default with a deduction or a lower long-term rate, such as Wisconsin (30% exclusion), South Carolina (44% deduction), and Massachusetts (5% on long-term gains, 8.5% on short-term). State residency for tax purposes turns on domicile and physical presence, not where you happen to place the trade. Check your state's department of revenue for its current schedule.
Does Florida have a capital gains tax?
No. Florida has no individual income tax, so a capital gain isn't taxed at the state level, whether it's short-term or long-term. You still owe federal capital gains tax (and the 3.8% NIIT if your income is high enough), but the Florida share is zero. The same is true for Texas, Nevada, Wyoming, South Dakota, and Alaska. Source: Florida Department of Revenue.
Which states have no capital gains tax?
Nine states levy no individual income tax and therefore don't tax capital gains as income: Alaska, Florida, Nevada, South Dakota, Texas, and Wyoming, plus New Hampshire and Tennessee, which have repealed their former taxes on interest and dividends. Washington is the one asterisk: no income tax, but it does charge a separate 7% excise tax on long-term capital gains above roughly $270,000 (indexed each year), so most sellers still owe nothing while very large gains do. Everywhere else, the state taxes the gain, usually at its ordinary income rates.
Was this calculator helpful?
Your rating helps us improve every EverydayBudd tool.
Educational tool. Results are estimates.
Educational only. Not individualized tax, legal, or financial advice. Consult a qualified tax professional for advice specific to your situation.