↑↓ to move ↵ to open Esc to close Browse all tools

Capital Gains Tax Calculator

Estimate the 2026 US federal tax on selling stock or other assets, with short- and long-term rates and the 3.8% net investment income tax. Amounts are in US dollars.

Your sale

Tax year 2026
$ Your adjusted basis
$  
How long you owned it
$ Wages, interest and the like, before deductions
$ Empty: the 2026 standard deduction
Other gains, losses and investment income
$
$

Your other sales this year, netted. Enter a loss with a minus sign, and include a loss carried over from last year.

$ Interest, dividends and rent. Only used for the 3.8% net investment income tax.
Federal tax on this sale
-

    Taxable income
    -
    Rate on the gain
    -
    Long-term rates used
    -
    Net investment income tax
    -
    Federal tax for the year
    -
    Adjusted gross income
    -

    Short-term or long-term

    HeldTax on the saleRateYou keep

    Long-term gains by rate

    RateGains taxed at itTax

    All of your long-term gains for the year after netting, this sale included. They are stacked on top of your other taxable income.

    Federal estimate only, not tax advice. Runs on your device. Nothing you enter is sent to a server.

    Capital Gains Tax Calculator by Freebiefy, free online tools

    Embed this tool on your site

    Paste this code into your page. The tool runs in the visitor's browser, free and without signup. The height adjusts to the content. All tools you can embed

    How capital gains are taxed

    IRS Topic 409 defines a capital gain or loss as the difference between the amount you realize when you sell an asset and your adjusted basis in it. It sorts gains by how long you held the asset. Held for more than one year, the gain is generally long-term; held one year or less, it is short-term. Net short-term gains are taxed as ordinary income at your regular federal income tax rates. Most long-term gains are taxed at 0%, 15% or 20%, depending on your taxable income.

    2026 long-term capital gains tax rates

    The rate depends on your taxable income for the year, including the gain, and your filing status. These are the 2026 thresholds from IRS Rev. Proc. 2025-32. Qualifying surviving spouses use the married filing jointly amounts.

    RateSingleMarried filing jointlyMarried filing separatelyHead of household
    0%Up to $49,450Up to $98,900Up to $49,450Up to $66,200
    15%$49,451 to $545,500$98,901 to $613,700$49,451 to $306,850$66,201 to $579,600
    20%Over $545,500Over $613,700Over $306,850Over $579,600

    Taxable income after deductions. The 2026 standard deduction is $16,100 single or married filing separately, $32,200 married filing jointly and $24,150 head of household.

    Why part of a gain can be taxed at 0% and part at 15%

    Your long-term gain is counted on top of your other taxable income, and each slice of it gets the rate of the range it lands in. Take a single filer with $60,000 of wages and the $16,100 standard deduction, who sells shares for a $20,000 long-term gain. The wages use up $43,900 of taxable income, so only $5,550 of the gain fits under the $49,450 limit for 0%. The other $14,450 is taxed at 15%, for a total of $2,167.50. If the same shares had been held one year or less, the whole gain would be taxed at ordinary rates: $3,750.00.

    Tax on a sale, as the calculator figures it
    tax for the year with the sale − tax for the year without it

    Working out the whole year twice catches every effect of the sale: a short-term gain pushing wages into a higher bracket, a long-term gain moving from 0% into 15%, or the gain crossing the threshold for the net investment income tax.

    The 3.8% net investment income tax

    On top of income tax, IRS Topic 559 charges a 3.8% net investment income tax when your modified adjusted gross income is above a threshold. It applies to the smaller of your net investment income, which includes capital gains, and the amount by which your income exceeds the threshold. The IRS notes that the thresholds are not indexed for inflation, and that modified adjusted gross income is adjusted gross income with certain foreign earned income added back. The calculator uses adjusted gross income.

    Filing statusThreshold
    Single or head of household$200,000
    Married filing jointly or qualifying surviving spouse$250,000
    Married filing separately$125,000

    Losses and netting

    Gains and losses for the year are netted. Short-term losses reduce short-term gains and long-term losses reduce long-term gains, and what is left of one side offsets the other. Only the long-term gain left after a net short-term loss gets the lower rates. If the year ends in a net loss, you can deduct up to $3,000 of it against other income, or $1,500 if married filing separately, and carry the rest forward, as Topic 409 explains. Enter your other sales in the optional fields, and the calculator nets them with this one.

    What the calculator does not cover

    • Gains taxed at higher maximum rates: according to Topic 409, net gains from collectibles such as coins or art are taxed at up to 28%, unrecaptured section 1250 gain from selling real property at up to 25%, and the taxable part of a gain on section 1202 qualified small business stock at up to 28%. The calculator treats every long-term gain at the 0, 15 and 20% rates.
    • Qualified dividends, which IRS Topic 404 says qualify for the lower capital gain rates. If you have them, they also take up room in the 0% and 15% ranges.
    • The alternative minimum tax, tax credits and state income tax. If you sold your home, enter only the part of the gain that is taxable.

    To see what your shares earn while you hold them, use the dividend calculator; the ROI calculator turns a purchase and sale price into a yearly return.

    How to use the capital gains tax calculator

    1. 1Pick your filing status, then enter what you paid for the asset and what you sold it for, and whether you held it more than one year.
    2. 2Enter your other income for the year before deductions. Leave Deductions empty for the standard deduction, or enter your itemized total. Add other gains, losses and investment income if you have them.
    3. 3Read the federal tax on the sale and how it splits across the rates, compare short-term and long-term in the table, and copy the result or a link.

    Tax year and sources

    All rates and thresholds are for tax year 2026 and were checked in October 2026.

    Frequently asked questions

    What is the difference between short-term and long-term capital gains?

    It depends on how long you owned the asset. According to IRS Topic 409, a gain is generally long-term if you held the asset for more than one year before selling it, and short-term if you held it one year or less. Net short-term gains are taxed as ordinary income at your regular rates, while most long-term gains get the lower rates of 0%, 15% or 20%.

    What are the long-term capital gains tax rates for 2026?

    For 2026, the 0% rate applies while your taxable income is up to $49,450 for single filers and $98,900 for married couples filing jointly. The 15% rate applies up to $545,500 single and $613,700 joint, and 20% above that. The table in the guide lists all four filing statuses, from IRS Rev. Proc. 2025-32.

    Does the 0% rate mean my whole gain is tax-free?

    Only the part of a long-term gain that fits under the 0% threshold, counted on top of your other taxable income. If your other taxable income already uses part of that room, less of the gain gets 0%, and the rest is taxed at 15%, or 20% at high incomes. The calculator shows how your gain splits across the rates.

    What is the net investment income tax?

    A 3.8% tax on investment income, including capital gains, for people with modified adjusted gross income above $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). It applies to the smaller of your net investment income and the amount your income exceeds the threshold. The IRS notes that these thresholds are not indexed for inflation.

    How much of a capital loss can I deduct?

    Losses first offset gains. If your losses are larger, IRS Topic 409 lets you deduct up to $3,000 of the net loss against other income in a year, $1,500 if married filing separately. The rest carries forward to later years. Enter a loss as a sale price below the purchase price, or with a minus sign in the other gains fields.

    Are state taxes included?

    No. The calculator estimates US federal tax only, for tax year 2026. Everything runs in your browser, and nothing you enter is sent to a server.