Skip to content

Calculators · Free calculator

Capital Gains Tax Calculator

Enter what you'll get for the sale, what you paid (or the value when you inherited it, or the giver's cost for a gift), how long you've held it and your other income. The calculator figures your federal return with and without the sale, so you see what the sale adds to your tax, how much of the gain is taxed at 0%, 15% or 20% once it sits on top of your other income, and how much more you could take this year before the tax rises.

Last reviewed by Steven Fox, CFP®, EA on · Tested with multiple methods across thousands of scenarios. How we test calculators

Save & share options
Embed on your siteGet the code to add this calculator to your page

This sale adds $2,168 to your 2026 federal tax. $5,550 of the gain is taxed at 0% and $14,450 at 15%.

Federal tax this sale adds$2,16810.8% of the $20,000 gain
Your sale

Which year's official figures to use. Your entries stay as they are.

After commissions and fees.

How you got it

Plus fees and reinvested dividends.

How long you’ve held it
Your other income

W-2 box 1, pensions, IRA withdrawals.

More options

Taxed like wages.

Form 1099-DIV, box 1b.

Include fund capital gain distributions.

Last year’s carryover worksheet.

Form SSA-1099, box 5.

HSA and other adjustments.

The larger one is used.

  • Held a year or less, it would add $3,753.
Where your gain is taxedStacked on your other income, the sale adds $5,550 at 0% and $14,450 at 15% to your taxable income.
Tax on this sale by other incomeWith other income under $47,500 the sale adds no tax; at your $60,000 it adds $2,168.
Show your return with and without the sale
Your 2026 federal return without and with the sale
LineWithoutWithChange
Net gain or loss (Schedule D)$0$20,000$20,000
Adjusted gross income$60,000$80,000$20,000
Standard deduction$16,100$16,100$0
Taxable income$43,900$63,900$20,000
Income tax$5,023$7,191$2,168
Total federal tax$5,023$7,191$2,168

What this uses

Tax year
2026 Source
Long-term gains and qualified dividends
0% up to $49,450 of taxable income, 15% up to $545,500, 20% above Source
Standard deduction
$16,100 Source
Capital loss deducted against other income
Up to $3,000 a year; the rest carries forward Source
Net investment income tax
3.8% on investment income above $200,000 of modified AGI Source
Schedule D worksheets
The 2025 worksheets with the 2026 figures; the 2026 instructions are not yet published Source
Credits
Not included: a credit could absorb some of the tax, and a gain can also reduce credits such as the child tax credit, the earned income credit and Marketplace premium help Source

How to use this calculator

  1. Enter what you'll get for the sale after fees, and your cost basis: what you paid plus fees and any reinvested dividends. Your brokerage's realized gains page or Form 1099-B shows both.
  2. If you inherited it, choose that and enter its value on the date of death instead: the step-up in basis. If it was a gift, enter the giver's basis and its value when you got it.
  3. Choose how long you've held it, the tax year and your filing status, and enter your wages and other income for the year.
  4. Under More options, add your other gains and losses this year, any loss carried from last year, interest and dividends, Social Security, and your age. Choose collectibles if you're selling art, coins, or gold or silver.

The numbers already filled in are an example. Replace them with your own.

How it's calculated

The rules come from Schedule D and its instructions, the Form 1040 instructions and IRS Publication 550. The calculator figures your federal return twice, with and without the sale, and the difference is the tax the sale adds. That is the only way to count everything a gain moves: the rate it lands at, the net investment income tax, and on some returns the taxable part of Social Security and the senior deduction.

Gains stack on top of your other income

Say you file single for 2026, earn $60,000 and sell shares for $30,000 that cost $10,000, a $20,000 long-term gain. Your wages fill the brackets first: after the standard deduction your taxable income is $43,900. The gain sits on top, so the first $5,550 of it falls under the year's 0% limit and the other $14,450 is taxed at 15%.

Your 2026 return, without and with the sale
LineWithoutWith
Taxable income$43,900$63,900
Federal income tax$5,023$7,191

The sale adds $2,168, 10.8% of the gain. Sold within a year, the same gain would add $3,753, taxed at your ordinary rates. A married couple with $90,000 of wages could take a $40,000 long-term gain and owe nothing on it: all of it fits under their 0% rate limit. Taxable income under $100,000 is taxed by the IRS Tax Table, as on the return itself, so the result can differ by a few dollars from arithmetic on the rate schedule.

When a gain at 0% still costs tax

A retiree, 65 or older, with a $20,000 pension and $30,000 of Social Security sells the same shares. Every dollar of the $20,000 gain is taxed at 0%, yet the sale adds $1,818: the gain raises the income that decides how much of Social Security is taxable, and $17,000 more of their income becomes taxable at ordinary rates.

Netting gains and losses, and the $3,000 limit

Short-term gains and losses are netted together, then long-term, then the two totals against each other. A net loss comes off your other income up to $3,000 ($1,500 on a separate return), and the rest is a capital loss carryover that keeps its short-term or long-term character. Sell the example's shares for $20,000 instead, a $10,000 loss, and the sale cuts your tax by $360 while $7,000 carries to 2027. A gain can also use up a carryover you'd otherwise keep; the calculator shows that as a cost even when it adds no tax this year. It follows the IRS carryover worksheet, and for 2025 to 2028 it adds the senior deduction back when it works out how much of the $3,000 was used, as the tax code does; where that changes the figure it shows both.

The 3.8% net investment income tax

Above $200,000 of adjusted gross income ($250,000 on a joint return, $125,000 on a separate one), a 3.8% tax applies to the smaller of your investment income and the amount you're over. A single filer with $250,000 of wages and a $100,000 long-term gain, all of it at 15%, owes $18,800 on the sale, $3,800 of it this 3.8% tax.

Collectibles

A long-term gain on a collectible is taxed at your ordinary rates, capped at 28%, with no 0% or 15% rate. At $60,000 of wages a $20,000 collectible gain adds $3,753, the same as a short-term gain. At $300,000 the 28% cap applies to all $50,000 of it, plus the 3.8% tax. A fund that holds gold or silver directly, as a trust, is a collectible; a fund of mining shares is not.

Inherited and gifted investments

Inherited property takes its value on the date of death as your basis and is always long-term. A gift keeps the giver's basis for a gain (carryover basis); for a loss your basis is the lower of that and its value when you got it, and a sale between the two has no gain or loss.

Assumptions and limits

  • Federal income tax and the 3.8% net investment income tax only. State and local tax on the gain, and the alternative minimum tax, aren't included.
  • Credits aren't included either way: a credit could absorb some of the tax the sale adds, and a gain can also reduce credits such as the child tax credit, the earned income credit and Marketplace premium help.
  • Your other income is one amount of wages and other ordinary income, plus interest and dividends. Pensions and retirement withdrawals aren't treated as investment income; the taxable part of a non-qualified annuity is, for the 3.8% tax, and isn't counted that way here. The qualified business income deduction and self-employment tax aren't included.
  • Itemized deductions are used as entered. A gain can lower some of them (medical expenses, state and local taxes above $500,000 of income, and in 2026 the limit in the top bracket), so the sale may add more tax than shown.
  • Only the sale itself can be a collectible; other gains you enter are treated as stocks, funds or other investments. A loss on something kept for personal enjoyment can't be deducted, and the calculator counts a collectible's loss as an investment loss.
  • One basis for the sale: it doesn't choose lots or work out average cost, and it doesn't compute wash sales. A gift's basis doesn't include any gift tax the giver paid. For inherited property, the value you enter is your whole basis; property owned jointly with the person who died may be stepped up only in part.
  • Not covered: home and rental property sales, depreciation recapture, 1031 exchanges, installment sales, qualified small business stock, section 1256 contracts, stock options and employee stock purchase plans.
  • On a separate return, it assumes you lived with your spouse during the year.
  • The 2026 figures use the 2025 Schedule D worksheets' lines with the 2026 rates and limits, since the 2026 worksheets aren't published yet.

Input field details

What to enter in each box, where to find the number, and how this calculator treats it. When two calculators give different answers from the same numbers, it's usually because they handle one of these differently.

What you’ll get for it

The sale price less commissions and other selling costs: the amount realized.

Where to find itForm 1099-B box 1d (proceeds), less any selling expenses your broker did not already take out; your trade confirmation shows both.

How this tool treats itThe amount realized less your basis is the gain or loss. A sale for $0, such as a worthless stock, is a loss of your whole basis.

Allowed range$0 to $100,000,000

How you got it

Whether you bought it, inherited it or received it as a gift. Each sets your basis a different way.

How this tool treats itBought: what you paid. Inherited: the value when the owner died. A gift: the giver’s basis, except that a sale at a loss uses the value when you got it if that was lower.

What you paid for it

Your cost basis: the purchase price plus commissions and fees, plus any dividends you reinvested in it.

Where to find itForm 1099-B box 1e, or your brokerage’s cost basis or realized gains page. For shares bought before 2011, the broker may not have it; your own records or old statements do.

How this tool treats itOne basis for the whole sale. If you are selling part of a holding bought at different times, enter the basis of the shares you are selling (your broker’s lot method decides which). A wash sale: when you buy the same or a substantially identical stock, bond or fund within 30 days before or after selling it at a loss, the loss can’t be deducted now and is added to the new shares’ basis instead.

Allowed range$0 to $100,000,000

Not includedChoosing which lots to sell, average cost for fund shares, and the wash-sale adjustment itself: enter the basis after any adjustment.

Cost basis in the glossary

Value on the date of death

What the investment was worth on the day the owner died. That stepped-up value is your basis.

Where to find itThe estate’s valuation, the executor, or the brokerage’s statement for the date of death; if the estate elected the alternate valuation date, enter the value on that date.

How this tool treats itInherited property gets a basis equal to its value at death (a step-up, or a step-down when it had fallen), and it is long-term however soon you sell it. The whole value is used as your basis.

Allowed range$0 to $100,000,000

Not includedProperty you owned jointly with the person who died: usually only their share is stepped up (in community property states, often all of it), so work out your basis first.

Step-up in basis in the glossary

What the giver paid for it, and its value when you got it

The giver’s cost basis, and what the investment was worth on the day you received it.

Where to find itAsk the giver or their broker for the cost basis; the value on the gift date is on the transfer statement or in the price history.

How this tool treats itFor a gain, your basis is the giver’s. If the value when you got it was lower than the giver’s basis and you sell for less than that value, your loss is measured from the value instead. Selling for an amount between the two gives neither a gain nor a loss.

Allowed range$0 to $100,000,000 each

Not includedGift tax the giver paid, which can add to your basis.

Carryover basis in the glossary

How long you’ve held it

More than a year, or a year or less.

Where to find itThe purchase date on your brokerage’s cost basis page (Form 1099-B box 1b), compared with the sale’s trade date.

How this tool treats itCount from the day after you bought it; the day you sell counts. More than a year is long-term and taxed at 0%, 15% or 20%; a year or less is short-term and taxed at your ordinary rates. For a gift, count the giver’s time too, unless you are selling for less than it was worth when you got it: then count from the day after the gift. Inherited property is always long-term.

Filing status

The status you will file under for the year of the sale.

How this tool treats itA qualifying surviving spouse uses the joint brackets and breakpoints. On a separate return, the tool assumes you lived with your spouse during the year.

Filing status in the glossary

Wages and other income

Your taxable income for the year other than this sale, interest and dividends: wages after pre-tax 401(k) contributions, pensions, retirement withdrawals and other ordinary income.

Where to find itForm W-2 box 1, Form 1099-R box 2a, or last year’s Form 1040 as a guide.

How this tool treats itNone of it is treated as investment income for the 3.8% tax. A business’s profit can be entered here only as an approximation: self-employment tax and the qualified business income deduction are not figured.

Allowed range$0 to $10,000,000

Taxable income in the glossary

What you’re selling

Stocks, funds, bonds or crypto; or a collectible.

How this tool treats itCollectibles include art, antiques, coins, stamps, gems and metals such as gold and silver bullion, including a fund that holds the metal itself as a trust. A long-term gain on one is taxed at your ordinary rates up to the top of the 24% bracket and at no more than 28% above it, with no 0% or 15% rate.

Not includedA loss on something you kept for personal enjoyment rather than as an investment can’t be deducted; the tool treats a collectible loss as an investment loss.

Collectibles investing in the glossary

Interest and nonqualified dividends

Taxable interest and the dividends that are not qualified.

Where to find itForm 1099-INT box 1; Form 1099-DIV box 1a less box 1b.

How this tool treats itTaxed at your ordinary rates. It counts as investment income for the net investment income tax: 3.8% on the smaller of your investment income and the amount your modified AGI is over $200,000 ($250,000 joint, $125,000 separate). Those thresholds are set by statute and not adjusted for inflation.

Allowed range$0 to $10,000,000

Net investment income tax in the glossary

Qualified dividends

Dividends taxed at the long-term capital gains rates.

Where to find itForm 1099-DIV box 1b.

How this tool treats itQualified dividends fill the 0% and 15% brackets alongside long-term gains, so they change how much of your gain lands at each rate.

Allowed range$0 to $10,000,000

Qualified dividend in the glossary

Other gains and losses this year

Your other sales this year, totalled by holding period: short-term gains, short-term losses, long-term gains and long-term losses. Include a fund’s capital gain distributions with long-term gains.

Where to find itYour broker’s year-to-date realized gain and loss report, or Form 1099-B; capital gain distributions are Form 1099-DIV box 2a.

How this tool treats itSchedule D nets short-term with short-term and long-term with long-term, then the two together. Your net capital gain, the part taxed at 0%, 15% or 20%, is the net long-term gain left after any net short-term loss. A net loss deducts up to $3,000 against other income ($1,500 on a separate return) and the rest carries forward.

Allowed range$0 to $100,000,000 each

Not includedOther gains are treated as stocks or funds, never collectibles; no real estate depreciation (unrecaptured section 1250 gain).

Capital gain in the glossary

Loss carried from last year

The short-term and long-term capital loss carryovers from last year’s return.

Where to find itLast year’s Capital Loss Carryover Worksheet (lines 8 and 13), or this year’s tax software, which carries them onto Schedule D lines 6 and 14.

How this tool treats itA capital loss carryover keeps its character: short-term losses net against short-term gains first, long-term against long-term. Next year’s carryover is figured by the same worksheet. For 2025 to 2028, the tool adds the senior deduction back when it works out how much of the $3,000 was used, as the statute says; where that changes the figure, it shows both.

Allowed range$0 to $100,000,000 each

Capital loss carryover in the glossary

Social Security benefits this year

Your total Social Security benefits for the year (both spouses’ on a joint return).

Where to find itForm SSA-1099 box 5.

How this tool treats itUp to 85% of benefits is taxable, depending on your other income. A gain raises that income, so it can make more of your benefits taxable and add tax beyond the rate on the gain itself.

Allowed range$0 to $500,000

65 or older

Tick for each of you who is 65 or older at the end of the year (born before January 2, 64 years before it).

How this tool treats itAdds the extra standard deduction for age and, for 2025 to 2028, the senior deduction of up to $6,000 each, which phases out as income rises; a gain can reduce it. The spouse box is read only on a joint return.

Senior deduction in the glossary

Adjustments to income

Deductions taken before AGI: HSA contributions, the deductible part of self-employment tax and similar.

Where to find itSchedule 1 (Form 1040), Part II.

How this tool treats itEnter a deductible IRA contribution as already figured: with Social Security its limit depends on AGI, which the tool does not work out.

Allowed range$0 to $1,000,000

Adjusted gross income in the glossary

Itemized deductions

Your total itemized deductions, if you itemize. The larger of this and the standard deduction is used.

Where to find itSchedule A line 17, or last year’s as a guide.

How this tool treats itHeld at the amount you enter, with and without the sale. A gain can lower some of them: medical expenses, state and local taxes once income passes about $500,000, and in 2026 the limit in the 37% bracket.

Allowed range$0 to $10,000,000

Itemized deductions in the glossary

Questions

How are capital gains taxed in 2026?
A gain on an investment held more than a year is taxed at 0%, 15% or 20%, and which rate depends on your taxable income with the gain stacked on top of your other income. A gain held a year or less is taxed at your ordinary rates, like wages. Above $200,000 of income ($250,000 on a joint return, $125,000 on a separate one) a 3.8% net investment income tax can apply too. In the example on this page, a single filer with $60,000 of wages and a $20,000 long-term gain pays $2,168 on it: $5,550 at 0% and $14,450 at 15%.
What is the 0% capital gains rate, and who gets it?
Long-term gains and qualified dividends are taxed at 0% while your taxable income, counting them, stays under the year's 0% limit for your filing status. A married couple with $90,000 of wages can take a $40,000 long-term gain and pay no federal tax on it, with $1,100 of room still left. If you take Social Security, a gain can still add tax even at 0%, because it can make more of your benefits taxable.
How long do I have to hold an investment for long-term rates?
More than one year. Count from the day after you bought it, and include the day you sell: shares bought on March 3 are long-term if sold on March 4 of the next year or later. Inherited property is long-term however long you held it. For a gift, the giver’s time counts too, unless you sell for less than it was worth when you got it.
How much of a capital loss can I deduct?
Losses first cancel your gains for the year, without limit. If you still have a net loss, up to $3,000 of it ($1,500 on a separate return) comes off your other income, and the rest carries to next year, keeping its short-term or long-term character. In the example on this page, a $10,000 loss cuts the tax by $360 and adds $7,000 to the loss carried forward.
What is my basis in stock I inherited?
Usually its value on the date the owner died (or on the alternate valuation date, if the estate used it), not what they paid. This is often called a step-up. Any gain from before the death is never taxed, and a sale is long-term even if you sell the week after you inherit.
What is my basis in stock someone gave me?
For a gain, the giver’s own basis carries over to you. For a loss, your basis is the lower of the giver’s basis and the value when you got the gift. If you sell for an amount between those two, there is neither a gain nor a loss. Choose “It was a gift” and the calculator works it out.
Are gold, silver and other collectibles taxed differently?
Yes. A long-term gain on a collectible (art, coins, stamps, gold or silver, including a fund that holds the metal itself as a trust) gets no 0% or 15% rate: it is taxed at your ordinary rates, capped at 28%. At $60,000 of wages, a $20,000 collectible gain adds $3,753, the same as a short-term gain. A short-term collectible gain is ordinary income like any other.
Does the wash sale rule apply to my loss?
If you sell a stock, bond or fund at a loss and buy the same or a substantially identical one within 30 days before or after the sale, the loss can’t be deducted now. It is added to the basis of the new shares, so you get it back when you sell them. The calculator doesn’t track your purchases, so it assumes the loss is deductible and reminds you of the rule.

Version history

  • October 10, 2026 (version 1.0.0): First version: the federal tax on a sale of investments, with netting, loss carryovers, inherited and gifted basis, collectibles, the net investment income tax and the 0% room, for 2025 and 2026.

Sources

AdviceOnly maintains high editorial standards to improve the quality and accuracy of our educational content. Content is written with the assistance of artificial intelligence tools following a rigorous quality assurance process, and periodically reviewed by credentialed and experienced human financial advisors. References used include government data, academic papers, interviews with industry experts, and reputable primary sources. You can learn more about our efforts to produce accurate content in our editorial policy.

  1. Instructions for Schedule D (Form 1040), 2025: capital loss carryover, 28% rate gain and Schedule D Tax Worksheets
  2. Schedule D (Form 1040), 2025: Capital Gains and Losses
  3. IRS Publication 550 (2025), Investment Income and Expenses: holding period, capital losses, capital gain tax rates
  4. IRS Publication 551, Basis of Assets: property received as a gift
  5. Instructions for Form 1040 (2025): Qualified Dividends and Capital Gain Tax Worksheet, Tax Table
  6. Instructions for Form 8960 (2025): Net Investment Income Tax
  7. IRS Publication 915 (2025), Social Security and Equivalent Railroad Retirement Benefits
  8. Rev. Proc. 2025-32 (Internal Revenue Bulletin 2025-45): 2026 tax rates, capital gains breakpoints and standard deduction
  9. Rev. Proc. 2024-40: 2025 tax rates and capital gains breakpoints
  10. 26 U.S.C. 1211 and 1212: limit on capital losses and carryovers
  11. 26 U.S.C. 1015: basis of property acquired by gift
  12. 26 U.S.C. 1223: holding period, including inherited property
  13. 26 U.S.C. 1091: wash sales

Want someone to check your numbers?

Browse advice-only planners who charge a transparent flat fee for advice, with no commissions and no percentage of your assets.