Capital Gains Tax Calculator
Estimate the federal tax from selling stocks, ETFs, mutual funds, or crypto -- and see how timing, losses, or spreading gains across years could change the result.
Last updated July 15, 2026
Capital Gains Tax Calculator
Loading calculator...
Most capital gains calculators do one thing: multiply your profit by a tax rate and stop there. This one goes further. Enter a sale of stock, an ETF, a fund, or crypto, and you will see your estimated federal capital gains tax, the Net Investment Income Tax (NIIT) if it applies, and your after-tax proceeds -- broken down so you can see exactly how each dollar of your gain is taxed, not just a single blended rate.
Then the Sell-or-Hold Decision Lab below your results compares what changes under different, legitimate scenarios: selling today versus waiting until the position qualifies for long-term treatment, offsetting the gain with a loss you already have, or realizing only part of the position this year. Every comparison is clearly labeled as an estimate based on the numbers you enter -- never a recommendation to sell, hold, or harvest anything.
How It Works
The engine follows the same mechanics as IRS Schedule D, the Qualified Dividends and Capital Gain Tax Worksheet, and Form 8960 (Net Investment Income Tax), at a level appropriate for a planning estimate:
- Net proceeds = sale price minus selling commissions and fees.
- Adjusted cost basis = purchase price plus acquisition fees and any basis adjustments.
- Realized gain or loss = net proceeds minus adjusted basis.
- Holding period: an asset must be held more than one year -- not one year exactly -- to qualify as long-term. The calculator uses real calendar-date math, including leap years, not a simple 365-day count.
- Netting: short-term gains/losses and long-term gains/losses are netted separately first. If one category is a net loss and the other a net gain, the loss offsets the gain (Schedule D Part III), before any remaining net loss is deducted against ordinary income (up to $3,000 a year, $1,500 if married filing separately) with the excess carried forward.
- Short-term gains are taxed as ordinary income. Rather than multiplying the gain by your top marginal rate, the calculator computes the incremental tax: your estimated tax with the gain included, minus your estimated tax without it -- which correctly reflects that only the top slice of the gain hits your highest bracket.
- Long-term gains and qualified dividends are stacked on top of your ordinary taxable income and allocated across the 0%, 15%, and 20% brackets -- so if part of your gain falls in a lower bracket, that part is taxed at that lower rate, not your top rate.
- NIIT applies a 3.8% surtax to the lesser of your net investment income or the amount your MAGI exceeds the threshold for your filing status ($200,000 single/head of household, $250,000 married filing jointly, $125,000 married filing separately) -- never 3.8% of the entire gain automatically.
Understanding Your Results
The estimated federal tax figure is the combined incremental impact of this sale: the short-term portion taxed as ordinary income, the long-term portion taxed at capital-gains rates, and NIIT if it applies. If you entered a loss that is deductible against other income, this number can be negative -- that is a real tax saving, not an error.
How this tax is built breaks that total into its three parts so you can see which piece is driving the result. Holding period shows whether this sale is short- or long-term today, and if not, the exact date it becomes long-term.
The Sell-or-Hold Decision Lab recomputes the same calculation under alternate assumptions -- a later sale date, an added loss, or a smaller realized amount -- so you can compare outcomes side by side. Each card lists its own assumptions plainly; none of them account for how your income, the asset's price, or tax law might actually change between now and a future date.
2026 long-term capital gains brackets
Long-term gains (and qualified dividends) are taxed at 0%, 15%, or 20% depending on where they fall once stacked on top of your ordinary taxable income:
| Rate | Single | Married filing jointly | Head of household |
|---|---|---|---|
| 0% | up to $49,450 | up to $98,900 | up to $66,200 |
| 15% | $49,451 – $545,500 | $98,901 – $613,700 | $66,201 – $579,600 |
| 20% | above $545,500 | above $613,700 | above $579,600 |
These figures are triangulated from public sources citing IRS Revenue Procedure 2025-32 and are pending direct verification against irs.gov by a qualified reviewer -- see the methodology section below.
Short-term vs. long-term, worked example
Say you bought $10,000 of stock and it is now worth $30,000 -- a $20,000 gain. Sell one day before the one-year mark and the entire $20,000 is taxed as ordinary income, at whatever your marginal rate is. Wait one more day and the same $20,000 is taxed at the long-term rates above instead -- for many filers, meaningfully less. The calculator's Decision Lab shows this exact comparison using your own numbers.
Crossing from the 0% into the 15% bracket
Long-term gains do not get one flat rate just because part of the gain crosses a bracket line. If your ordinary income leaves $5,000 of room in the 0% bracket and your long-term gain is $20,000, the first $5,000 of that gain is taxed at 0% and only the remaining $15,000 is taxed at 15% -- not the whole $20,000.
Gain and loss netting, worked example
Suppose you have a $15,000 long-term gain from one sale and a $6,000 short-term loss from another. Schedule D nets the loss against the gain first: $15,000 − $6,000 = $9,000 of net long-term gain left to tax. If instead your losses exceeded your gains for the year, up to $3,000 of the excess is deductible against ordinary income, and any remaining loss carries forward to next year.
Cost basis
Your cost basis is not just what you paid -- it includes reinvested dividends (each reinvestment is its own purchase with its own basis) and can be adjusted for stock splits, return-of-capital distributions, and wash-sale disallowed losses. Getting basis wrong is one of the most common capital-gains reporting errors -- start with your brokerage's Form 1099-B, then verify the reported basis against your own records and any required adjustments, since brokerages do not always have your complete cost-basis history (for example, shares transferred in from another broker).
Pros and Considerations
Benefits
- •Breaks the tax into its actual short-term, long-term, and NIIT components instead of one blended rate
- •Correctly stacks long-term gains on top of ordinary income across the 0/15/20% brackets, including gains that cross a bracket line
- •Compares selling now against waiting for long-term treatment, offsetting with a loss, or realizing only part of the position
- •Free, no account required, and does not require contact information to see a result
Considerations
- •Federal estimate only -- state capital gains tax is not yet included
- •Supports a single primary sale plus other-gains/losses inputs, not a full multi-lot transaction ledger
- •Cannot know your actual income, the asset's future price, or next year's tax law -- scenario comparisons are estimates, not projections
Important Notes
- •This calculator covers stocks, ETFs, mutual funds, and cryptocurrency only.
- •It does not calculate rental-property depreciation recapture, primary-residence sale exclusions, 1031 exchanges, collectibles (28% maximum rate), qualified small business stock, employee stock compensation, inherited or gifted property with uncertain basis, installment sales, wash-sale adjustments, or Opportunity Zone deferrals -- each of these has special rules a general calculator would misrepresent if it guessed.
- •State capital gains tax is not included in this version.
- •2026 federal bracket figures were sourced from public secondary sources citing IRS Revenue Procedure 2025-32, not fetched directly from irs.gov, and are pending direct verification by a qualified tax reviewer.
- •This calculator is publicly available as a planning estimate and is undergoing final professional tax review.
Warnings
- •This tool provides an estimate for planning purposes only. It is not tax advice and does not replace Schedule D, Form 8949, or a qualified tax professional.
- •Results depend entirely on the accuracy of what you enter. Verify your actual cost basis against your broker's 1099-B before relying on any number here.
- •Tax law can change. Figures are specific to the 2026 tax year as understood at the time this calculator was published.
Frequently Asked Questions
How is capital gains tax calculated?
What is the capital gains tax rate for 2026?
Are capital gains based on gross income or taxable income?
How are short-term capital gains taxed?
How are long-term capital gains taxed?
Can part of my gain be taxed at 0% and another part at 15%?
Does the 3.8% NIIT apply to the entire gain?
How do capital losses reduce capital gains?
Do selling fees reduce my capital gain?
Are reinvested dividends included in cost basis?
Does my state tax capital gains?
How long must I hold an investment for long-term treatment?
How are cryptocurrency gains taxed?
Does the calculator support home sales?
Do I need to make an estimated tax payment after selling stock?
Related Calculators
References
- IRS Schedule D (Form 1040), Capital Gains and Losses
- IRS Form 8949, Sales and Other Dispositions of Capital Assets
- IRS Form 8960, Net Investment Income Tax
- IRS Publication 550, Investment Income and Expenses
- IRS Topic No. 409, Capital Gains and Losses
- IRS Revenue Procedure 2025-32 (2026 inflation adjustments)