Money
Capital Gains Tax Calculator: What You Owe When You Sell Stock
The federal tax on your profit, and what you keep after selling
This capital gains tax calculator works out the federal tax when you sell stock in 2026: enter the shares, the purchase and sale price, your fees and your income, and you get the tax at the 0%, 15% or 20% long-term rate or at your ordinary bracket, plus the net investment income tax if it applies.
The key idea
Waiting one more day can cut your tax rate
Stock held more than one year pays the long-term rate: 0% for a single filer with taxable income up to $49,450 in 2026, 15% up to $545,500 and 20% above. Sell after a year or less and the gain is taxed like your salary, at up to 37%. On a $2,980 gain with $80,000 of income, that is $447 of tax instead of $655.60.
How it is calculated
Your capital gain is what you get from the sale minus what you paid, including commissions and fees (your cost basis):
Gain = shares × (sale price − purchase price) − fees
Long-term gains, on stock held more than one year, are taxed at 0%, 15% or 20%. The rate depends on your taxable income, and the gain sits on top of your other income. In 2026 (IRS Rev. Proc. 2025-32):
| Filing status | 0% up to | 15% up to | 20% above |
|---|---|---|---|
| Single | $49,450 | $545,500 | $545,500 |
| Married filing jointly | $98,900 | $613,700 | $613,700 |
| Head of household | $66,200 | $579,600 | $579,600 |
| Married filing separately | $49,450 | $306,850 | $306,850 |
Short-term gains, on stock held one year or less, are taxed as ordinary income, from 10% to 37%.
On top, the net investment income tax adds 3.8% when your modified adjusted gross income passes $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 investment income and the excess over the threshold. The calculator takes your taxable income as your income before the sale minus the standard deduction.
Worked example
A single filer with $80,000 of income sells 100 shares bought at $50 for $80 after more than a year, with $20 of fees. The gain is $8,000 − $5,000 − $20 = $2,980. Taxable income before the sale is $80,000 − $16,100 = $63,900, above the 0% limit, so the whole gain pays 15%: $447. Sold within a year, it would pay the 22% bracket: $655.60.
Official sources
- IRS Revenue Procedure 2025-32: 2026 inflation adjustments (tax brackets, standard deduction, credits) · sec. 4.03 long-term capital gains thresholds, 4.01 tax brackets, 4.14 standard deduction
- IRS Topic no. 409: Capital gains and losses · long-term vs. short-term, cost basis, $3,000 loss limit
- IRS Topic no. 559: Net investment income tax · 3.8% net investment income tax and thresholds
Common questions
Frequently asked questions
What is the capital gains tax rate for 2026?
0%, 15% or 20% on long-term gains, depending on your taxable income. A single filer pays 0% up to $49,450, 15% up to $545,500 and 20% above; married couples filing jointly, 0% up to $98,900 and 15% up to $613,700.
How long do I have to hold stock to pay the long-term rate?
More than one year. Shares sold after one year or less produce a short-term gain, taxed at your ordinary income tax rate.
Do I pay tax on stock I have not sold?
No: a rise in the price of shares you still own is not taxed. You pay when you sell at a gain, and on any dividends you receive.
Can I deduct a loss on stock?
Yes: capital losses offset capital gains, and a net loss offsets up to $3,000 of other income a year ($1,500 if married filing separately). The rest carries forward to later years.
What is the 3.8% tax on investment income?
The net investment income tax: 3.8% on investment income, including capital gains, when your modified adjusted gross income passes $200,000 for single filers or $250,000 for married couples filing jointly.
Do commissions reduce my capital gain?
Yes: fees and commissions are part of your cost basis and reduce the gain you are taxed on.
Saving and interest
News
Money
You may also need
Federal Income Tax Calculator 2026 and 2027
2026 or 2027 federal tax, effective and marginal rate, refund or balance due.
CalculateInflation Calculator: What Your Dollars Are Worth Today
Past dollars in today's money, with the official CPI.
CalculateCompound Interest Calculator
How much your savings grow with monthly deposits.
Calculate401k Calculator
Retirement balance with your contributions, the match and 2026 limits.
CalculateYour next calculation
Missing a calculator?
Tell us what you need to calculate. The most requested ones are the first we build, with their formula, a worked example and the source.