Skip to main content

Capital Gains Tax Calculator for Stock Sales

On a $10,000 stock gain, a single filer with $60,000 of taxable income owes about $1,500 in federal tax if the shares were held more than a year, and about $2,200 if they were sold within a year (2026 rates).

Your sale

In US dollars. Nothing you type leaves your browser.

Your estimated tax

$1,500

15% of your $10,000 gain, long-term.

Capital gain
$10,000
Taxed at 0%
$0
Taxed at 15%
$10,000
Taxed at 20%
$0
Federal tax on the gain
$1,500
Net investment income tax (3.8%)
$0
Total tax
$1,500
Left after tax
$8,500

How the tax is calculated

  1. Gain = proceeds minus cost basis. More than one year of holding is long-term; one year or less is short-term.
  2. A short-term gain is added to your taxable income and taxed at the 2026 ordinary brackets. The tax is the bracket tax with the gain minus the bracket tax without it.
  3. A long-term gain is stacked on top of your taxable income. The part under the 0% limit for your filing status pays nothing, the part up to the 15% limit pays 15%, and the rest pays 20%. If that comes to more than the regular tax on the same income, the IRS worksheet caps it at the regular tax (line 25).
  4. The 3.8% net investment income tax applies to the smaller of the gain and the amount your AGI plus the gain exceeds the threshold for your filing status.
  5. State tax is your flat rate times the gain. A loss pays no tax, and up to $3,000 ($1,500 if married filing separately) can offset other income.

Federal tax on one stock sale, tax year 2026. Not included: collectibles and unrecaptured section 1250 gain, wash sales, other gains or losses in the same year, other investment income in the NIIT base, alternative minimum tax, and state rules beyond a flat rate. If you leave AGI blank, it is estimated as taxable income plus the 2026 standard deduction for your filing status. Section 1202 small business stock (28% rate) is not modeled. Ordinary tax uses the exact 2026 bracket formulas; the IRS Tax Table used below $100,000 can differ by a few dollars. If your income is below your deductions, enter 0: leftover deductions are not applied to the gain. The loss carryforward assumes your other taxable income is at least the deduction amount.

Sources, read on 2026-10-27

Capital gains tax on stocks: common questions

How much is capital gains tax on stocks in 2026?

It depends on how long you held the shares and your other income. Gains on stock held more than one year are taxed at 0%, 15% or 20% for most stock. Gains on stock held one year or less are taxed as ordinary income, at 10% to 37%. In the example above ($10,000 gain, single, $60,000 taxable income) the federal tax is $1,500 long-term and $2,200 short-term.

What are the 2026 long-term capital gains tax brackets?

The 0% rate applies up to $49,450 of taxable income for single filers and $98,900 for married couples filing jointly. The 15% rate applies above that, up to $545,500 single and $613,700 joint. The 20% rate applies above those amounts. Head of household: $66,200 and $579,600. Married filing separately: $49,450 and $306,850. The gain counts toward the income that decides the band.

Can I pay 0% capital gains tax on stocks?

Yes, when your taxable income including the gain stays at or under the 0% limit. With $20,000 of other taxable income, a single filer selling the same $10,000 gain owes $0 in federal tax. Only the part of the gain that fits under $49,450 is taxed at 0%.

What counts as short-term vs long-term?

Long-term means you held the stock for more than one year before selling. One year or less is short-term, and the gain is added to your ordinary income.

When does the 3.8% net investment income tax apply?

When your modified adjusted gross income is above $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). The tax is 3.8% of the smaller of your net investment income and the amount above the threshold. With $416,100 of AGI before the sale, the same $10,000 gain adds $380 of this tax.

Can I deduct a loss on a stock sale?

Capital losses first offset capital gains. If losses exceed gains, you can deduct up to $3,000 a year against other income ($1,500 if married filing separately) and carry the rest forward. This calculator shows the deduction and carryforward for a single sale at a loss.

Does this calculator include state tax?

Only as a flat percentage you enter yourself. State rules differ and some states tax long-term gains like ordinary income, so check your state revenue department for the right figure.

This calculator is an educational tool, not tax or financial advice. It estimates federal tax on one sale from the figures you enter; your return can differ. Check the IRS sources above or ask a tax professional.