Skip to main content
🧮 Free Calculator

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:

  1. Net proceeds = sale price minus selling commissions and fees.
  2. Adjusted cost basis = purchase price plus acquisition fees and any basis adjustments.
  3. Realized gain or loss = net proceeds minus adjusted basis.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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:

RateSingleMarried filing jointlyHead of household
0%up to $49,450up to $98,900up to $66,200
15%$49,451 – $545,500$98,901 – $613,700$66,201 – $579,600
20%above $545,500above $613,700above $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?
Start with your realized gain (sale price minus fees, minus your adjusted cost basis). Short-term gains (assets held one year or less) are taxed as ordinary income at your regular tax brackets. Long-term gains (held more than one year) are taxed at preferential 0%, 15%, or 20% federal rates, stacked on top of your other taxable income, plus a 3.8% Net Investment Income Tax if your income is high enough.
What is the capital gains tax rate for 2026?
Long-term rates are 0%, 15%, or 20% depending on your taxable income and filing status. Short-term gains use the same ordinary income brackets as your wages: 10% to 37% for 2026. Most filers land in the 15% long-term bracket; the 0% bracket covers taxable income up to $49,450 (single) or $98,900 (married filing jointly) for 2026.
Are capital gains based on gross income or taxable income?
Taxable income -- your income after the standard or itemized deduction -- not gross income. This matters because it determines which capital-gains bracket your gain is stacked into.
How are short-term capital gains taxed?
As ordinary income, at the same marginal tax brackets that apply to your wages. There is no separate, lower short-term capital-gains rate.
How are long-term capital gains taxed?
At 0%, 15%, or 20%, based on where the gain falls once stacked on top of your other taxable income for the year -- not a single flat rate applied to the whole gain.
Can part of my gain be taxed at 0% and another part at 15%?
Yes. If your ordinary income leaves room in the 0% bracket, that portion of your long-term gain is taxed at 0%, and only the amount above that breakpoint is taxed at 15% (or 20% if it goes high enough). This calculator shows that split explicitly rather than applying one rate to the entire gain.
Does the 3.8% NIIT apply to the entire gain?
No. NIIT applies to the lesser of your net investment income or the amount your modified adjusted gross income exceeds the threshold for your filing status ($200,000 single, $250,000 married filing jointly, $125,000 married filing separately). Below that threshold, NIIT does not apply at all.
How do capital losses reduce capital gains?
Losses are netted against gains in the same category first (short-term against short-term, long-term against long-term), then an excess loss in one category offsets a gain in the other. Any remaining net loss is deductible against ordinary income up to $3,000 a year ($1,500 married filing separately), with the rest carried forward to future years.
Do selling fees reduce my capital gain?
Yes. Selling commissions and transaction fees reduce your net proceeds, and acquisition fees increase your cost basis -- both reduce the taxable gain.
Are reinvested dividends included in cost basis?
Yes. Each reinvested dividend is treated as a new purchase with its own cost basis and its own holding period. Forgetting to include reinvested dividends is one of the most common ways investors overstate their taxable gain.
Does my state tax capital gains?
This calculator estimates federal tax only. Nine states currently have no general income tax -- Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming -- so residents of most of them owe no state tax on this gain. The exception is Washington, which has no general income tax but does apply a separate state capital gains excise tax to large long-term gains on stocks, funds, and similar assets above an annually-adjusted threshold (real estate sales are exempt from this tax); this calculator does not model it. Many other states tax capital gains in some form, often as part of ordinary state income tax, but rules vary widely -- check with your state's tax authority or a tax professional for your specific situation. Full state-by-state support is planned for a future update.
How long must I hold an investment for long-term treatment?
More than one year -- not one year exactly. An asset sold on the one-year anniversary of purchase is still short-term; it must be sold at least one day after that anniversary to qualify as long-term.
How are cryptocurrency gains taxed?
The IRS treats cryptocurrency as property, so the same short-term/long-term capital gains rules that apply to stocks apply to crypto. Every disposal -- selling for cash, trading for another token, or spending it -- is a taxable event.
Does the calculator support home sales?
Not this one -- primary-residence sales involve the Section 121 exclusion ($250,000/$500,000) and other rules this calculator does not model. Use the dedicated Home Sale Tax Calculator instead, which walks through the exclusion eligibility tests and estimates tax on anything above it.
Do I need to make an estimated tax payment after selling stock?
Possibly, depending on your withholding and prior-year tax. This calculator can estimate the tax attributable to a sale so you know roughly how much to set aside, but it does not calculate required quarterly estimated payments or underpayment penalties -- consult a tax professional for that determination.

Related Calculators

References

  1. IRS Schedule D (Form 1040), Capital Gains and Losses
  2. IRS Form 8949, Sales and Other Dispositions of Capital Assets
  3. IRS Form 8960, Net Investment Income Tax
  4. IRS Publication 550, Investment Income and Expenses
  5. IRS Topic No. 409, Capital Gains and Losses
  6. IRS Revenue Procedure 2025-32 (2026 inflation adjustments)
← All Calculators