📈 Capital Gains Tax Calculator (USA) — LT/ST + NIIT + State
Estimate federal long-term/short-term capital gains taxes, NIIT (3.8%) impact, state tax, and net proceeds. Built-in year presets included — override rates anytime.
Taxpayer & Rate Options
Capital Gains Tax Calculator (USA): How to Estimate Short-Term, Long-Term Tax, NIIT & Net Proceeds (Complete Guide)
Introduction — Why estimating capital gains taxes matters
Selling an asset — a stock, investment property, or crypto — often triggers a tax event you can’t ignore. Depending on how long you held the asset and your total income, the tax bill can range from 0% to 37% (federal) plus NIIT (3.8%) and state taxes. That’s a big difference.
Before you sell, calculate your likely tax liability. Knowing what you’ll ultimately keep — your net after-tax proceeds — helps you evaluate whether the sale makes financial sense. That’s what the Capital Gains Tax Calculator does: it converts purchase and sale details into a clear tax and net-proceed estimate so you can plan smarter.
This guide explains every step: short-term vs long-term gains, rates and brackets, NIIT, state tax, AMT considerations, sample calculations, and realistic planning tips.
Short-Term vs Long-Term Capital Gains — the core difference
The single most important thing that affects capital gains tax is how long you held the asset:
Short-Term Capital Gains (STCG): Holding period less than 1 year (365 days). Taxed as ordinary income at your marginal federal income tax rate (10%–37% in current brackets). Short-term gains can be painful — a large one could push you into a higher bracket.
Long-Term Capital Gains (LTCG): Holding period 1 year or more. Taxed at preferential federal rates: 0%, 15%, or 20% for most taxpayers — depending on taxable income and filing status. Many savvy investors hold for the long term to access the lower LTCG rates.
Example: If a long-term gain falls into the 15% bracket, your federal tax on that gain is 15% (before considering NIIT or state tax). By contrast, selling earlier could be taxed at your marginal rate (say 24% or 35%).
How federal long-term capital gains brackets work
Long-term capital gains are taxed based on your taxable income for the year (ordinary income plus the gain). The IRS uses thresholds to decide whether your gain is taxed at 0%, 15%, or 20%. If your taxable income plus the gain stays below the 0% threshold, you pay no federal LTCG tax. If it sits between the 0% and 15% threshold, the gain is taxed at 15%, and so on.
Because the gain itself increases your taxable income, part of the gain can fall in a lower bracket and the rest in a higher bracket — in practice many calculators simplify this with approximate blended percentages, or compute accurately by layering amounts into bracket ranges.
Important: tax brackets and threshold numbers change each year. The calculator includes conservative yearly presets, and you can override the rates to match the current tax tables or your CPA’s guidance.
Net Investment Income Tax (NIIT) — the extra 3.8% for high-income taxpayers
The Net Investment Income Tax (NIIT) is a 3.8% surtax that applies to the lesser of:
Your net investment income (interest, dividends, capital gains, rental income, etc.), and
The amount by which your modified adjusted gross income (MAGI) exceeds the filing-status threshold.
Standard NIIT thresholds:
Single & Head of Household: $200,000
Married Filing Jointly (MFJ): $250,000
Married Filing Separate (MFS): $125,000
Example: If your MAGI is $260,000 (MFJ threshold $250,000), and your net investment income is $20,000, then the NIIT base is the lesser of $20,000 and $10,000 (excess MAGI), so NIIT = 3.8% × $10,000 = $380. The calculator uses this rule and lets you enter MAGI or override the NIIT threshold.
Tip: NIIT is applied in addition to your regular federal tax on the gain. For high earners, the combined effect of LTCG + NIIT + state tax can be significant.
State capital gains tax — remember state rules
Many states tax capital gains the same way they tax ordinary income. A few states have preferential treatments, and a handful have no income tax (e.g., Florida, Texas). Always check your state’s rules.
The calculator accepts a state effective tax rate so you can estimate state tax quickly. If your state taxes capital gains as ordinary income, an effective state rate equal to your state income tax rate is a reasonable input.
Alternative Minimum Tax (AMT) — when to watch out
AMT is complex. Historically, it could affect the tax treatment of certain capital gains, especially for large gains and taxpayers who exercise incentive stock options (ISOs). Modern AMT exposure is less common due to higher AMT exemption amounts, but it still matters in some cases.
This calculator does not attempt a full AMT simulation (AMT requires a complex separate tax base calculation). If you have events like large ISOs, or significant preference items or adjustments, ask a tax professional to model AMT impact. The article’s example section points out common AMT triggers.
Step-by-step: How to use the Capital Gains Tax Calculator
Enter purchase price (per unit) and sale price (per unit).
Add quantity (how many shares / units / assets sold).
Enter holding period (days) — the tool uses 365 days threshold.
Fill in improvements (e.g., capitalized costs for property) and selling costs (broker commissions).
Provide taxable income before the sale (helps auto-estimate LTCG bracket).
Choose filing status and tax year preset (or Manual if you want to type rates).
Optionally enter MAGI and toggle NIIT on/off.
Click Calculate (the built-in 15-second progress gives you a quick animation) — then read the results: net proceeds, federal LT/ST tax, NIIT, state tax, net after tax.
Everything runs in your browser. No data leaves your machine.
Detailed example — long-term sale with NIIT
Scenario:
Purchase: $10,000 (100 shares at $100)
Sale: $25,000 (100 shares at $250)
Holding: 400 days (long-term)
Selling costs: $150
Improvements / adjustments: $0
Filing status: MFJ
Taxable income before sale: $240,000
MAGI (for NIIT): $260,000
State tax rate: 5%
Steps:
Net proceeds = $25,000 − $150 = $24,850
Cost basis = $10,000
Capital gain = $14,850 (long-term)
LTCG bracket: MFJ presets indicate 0% up to ≈ $89k, 15% up to ≈ $553k — here gain falls in 15% bracket
Federal LTCG = 15% × $14,850 = $2,227.50
NIIT: MAGI exceeds MFJ threshold ($250k) by $10,000. NIIT base = min(net investment income $14,850, excess MAGI $10,000) = $10,000 → NIIT = 3.8% × $10,000 = $380
State tax = 5% × $14,850 = $742.50
Total tax = $2,227.50 + $380 + $742.50 = $3,350
Net after tax = $14,850 − $3,350 = $11,500
This gives you a clear picture of how federal LTCG + NIIT + state tax reduce the gain and what you ultimately keep.
Example — short-term sale taxed at ordinary rates
Scenario: same purchase/sale but holding 200 days (short-term). Assume marginal rate for taxpayer is 24%.
Short-term gain = $14,850
Federal tax = 24% × $14,850 = $3,564
NIIT test is the same; if applicable add NIIT on lesser of gain and MAGI excess
State tax = 5% × $14,850 = $742.50
Total tax ≈ $4,306.50 (plus NIIT if applicable)
Net after tax ≈ $10,543.50
Short-term sale in the 24% bracket costs more than long-term taxed at 15% — a key reason to hold investments at least one year when practical.
How to treat capital improvements and selling costs
Capital improvements (for property) increase your basis, reducing the gain. Save receipts.
Selling costs (broker commissions, transfer taxes) reduce proceeds directly. Include them in the calculator.
Adjustments: corporate actions, reinvested dividends, wash sales, and split handling can affect basis. Keep careful records.
Wash sale rule & cryptocurrency / special assets
The wash sale rule disallows a loss if you buy substantially identical securities within 30 days before or after the sale. That rule applies to stocks and most securities, but historically does not apply to crypto (treatment evolving). Be careful: disallowed losses increase basis later.
For complex assets (business interests, collectibles, crypto, options, restricted stock), basis rules and timing vary — the calculator gives a straightforward estimate, but consult a specialist for edge cases.
NIIT, AMT and other special taxes — key takeaways
NIIT: 3.8% surtax on net investment income for higher earners — applied in addition to federal tax. Use the MAGI threshold test.
AMT: complicated; can affect taxpayers with large preference items (ISOs, large itemized deductions, etc.). If you suspect AMT exposure, ask a tax pro.
State taxes: can dramatically increase your effective rate. Consider state residency timing around big sales carefully (but consult a lawyer — moving solely for tax avoidance has legal considerations).
Filing tips & year-end planning strategies
Harvest losses: Realized losses offset gains — tax-loss harvesting reduces net capital gain.
Time the sale: Hold for 12 months when possible. If you’re near a lower LTG bracket threshold, partial selling or staging sales across years can reduce rates.
Consider installment sales: Spreading gain over years may keep you in a lower bracket and reduce NIIT exposure.
Roth conversions & MAGI: Timing Roth conversions around sales and harvest strategies matters because MAGI triggers NIIT.
Use tax-advantaged accounts: When possible, use IRAs/401(k)s for trades to defer tax (but beware withdrawal rules).
Common mistakes people make
Assuming long-term always beats short-term — sometimes tax-loss harvesting and timing matter.
Forgetting NIIT and state tax in calculations.
Miscomputing basis when reinvesting or receiving stock splits.
Ignoring AMT triggers like ISOs.
Not keeping transaction and cost records (basis documentation).
12 Practical FAQs (short answers)
What is the holding period for long-term capital gains?
365 days or more.What are the federal long-term capital gains rates?
Usually 0%, 15%, or 20% (depending on taxable income); can be 28% for some collectibles.What is the Net Investment Income Tax (NIIT)?
A 3.8% surtax on net investment income for taxpayers with MAGI above set thresholds.Are capital gains taxed at state level?
Often yes — many states tax gains as ordinary income.Does selling my house always cause capital gains tax?
Primary residence exclusion may shelter up to $250k ($500k MFJ) if you meet tests.Can I offset gains with losses?
Yes — capital losses offset gains; excess losses offset ordinary income up to $3,000/year.Does tax-loss harvesting work for crypto?
Yes, but wash sale rules differ between securities and crypto — rules are evolving.Are inherited assets taxed differently?
Basis is generally stepped up to fair market value at death, reducing gain for heirs.How is NIIT calculated?
NIIT = 3.8% × min(net investment income, MAGI − threshold).Do I pay tax when selling shares inside an IRA?
No — trades inside tax-deferred accounts are not immediate taxable events until distribution.How do I report capital gains?
Use Schedule D and Form 8949 with Form 1040, attaching broker 1099-B forms.Should I pay estimated tax on a large gain?
Often yes — to avoid underpayment penalties, pay estimated tax or increase withholding.
Final words — use the calculator, then verify with a pro
The built-in calculator gives a fast, honest estimate of what you’ll pay — factoring LT/ST, NIIT, and state tax. It’s invaluable for deciding whether to sell, when to sell, and how to reduce tax through planning.
But tax law is precise and personal. After you run scenarios here, bring your numbers to a CPA or tax attorney to finalize reporting, consider AMT, and implement timing strategies.
Please don’t forget to leave a review.