Stock Capital Gains Tax Calculator

Your tax depends on how long you held the stock and how much other income you have. Stock held more than one year gets the long-term rates. Those rates are 0%, 15% or 20%, depending on where the gain lands on top of your other taxable income. A gain on stock held one year or less is taxed as ordinary income. High earners also add the 3.8% Net Investment Income Tax. The stock capital gains tax calculator below shows your gain, federal tax, surtax and proceeds after tax for 2026.

In our internal calculation, we took a single filer with $85,000 of other taxable income. They sell stock bought for $30,000 for $50,000, which is a $20,000 gain. If they held it more than one year, the gain is taxed at 15%, so the tax is $3,000. If they held it one year or less, the same gain is taxed at 22% as ordinary income. That tax is $4,400. Holding past one year saves $1,400.

Interactive — edit any field

How it works

The calculator starts with your gain, which is sale proceeds minus cost basis. Under IRS Topic 703, your basis for stock is the purchase price plus commissions and recording or transfer fees. The calculator does not check basis. You also enter your filing status, your taxable income before this sale (after deductions) and your holding period. IRS Topic 409 treats stock held more than one year as long-term. In our internal calculation, we re-implemented the 2026 stacking rule in two separate programs. We ran the scenarios below through both to see how income and holding period change the tax. The two programs agreed on every scenario, and you can enter the same numbers in the calculator above to check them. Take a single filer with $20,000 of other taxable income and a $5,000 long-term gain. The whole gain sits inside the 0% bracket, so the tax is $0. To see the profit on a position before tax, use our stock profit calculator, and our guide to realized vs unrealized gains explains when a gain counts as realized.

Long-term gains are stacked on top of your other taxable income. The part of the gain at or below the 0% limit is taxed at 0%. The part between the 0% limit and the 15% limit is taxed at 15%. Anything above the 15% limit is taxed at 20%. The limits come from Revenue Procedure 2025-32. For single filers, the 0% bracket runs to $49,450 of taxable income. The 15% bracket runs to $545,500. Married couples filing jointly get limits of $98,900 and $613,700. Heads of household get $66,200 and $579,600. Married filing separately shares the $49,450 zero-rate limit but tops out at $306,850 for the 15% rate. At $85,000 of other taxable income, a single filer is already past the 0% limit. Every dollar of a $20,000 long-term gain then lands at 15%. A single filer with $40,000 of other taxable income and a $20,000 long-term gain lands in two brackets. The first $9,450 fills the rest of the 0% bracket. The other $10,550 is taxed at 15%, for a tax of $1,582.50. At $540,000 of other taxable income, a single filer's $30,000 gain crosses the top threshold. Of that gain, $5,500 is taxed at 15%. The remaining $24,500 is taxed at 20%, which brings the income tax to $5,725. The Net Investment Income Tax adds $1,140, for a total of $6,865.

Short-term gains are taxed as ordinary income at graduated rates. The calculator figures the ordinary-income tax on your other taxable income plus the gain, then subtracts the tax on your other taxable income alone. For single filers in 2026, the 22% bracket ends at $105,700. The 24% bracket ends at $201,775. In the $85,000 case, income plus gain comes to $105,000. That total sits under $105,700, so the whole $20,000 is taxed at 22% for a tax of $4,400. A single filer with $100,000 of other taxable income and a $10,000 short-term gain crosses a bracket line. The first $5,700 of the gain is taxed at 22%. The other $4,300 is taxed at 24%, for a tax of $2,286. You can find your tax bracket or read how ordinary income vs capital gains tax differ. The Net Investment Income Tax is 3.8%, per IRS Topic 559. It applies to the smaller of the gain or the amount by which modified adjusted gross income (MAGI) is over a threshold. The threshold is $200,000 for single and head of household filers. It is $250,000 for married filing jointly and $125,000 for married filing separately. The calculator estimates MAGI as your taxable income plus the 2026 standard deduction plus the gain. That deduction is $16,100 for single filers and $32,200 for joint filers. If you itemize, the estimate understates your MAGI. A single filer with $190,000 of other taxable income sells for a $40,000 long-term gain. Income tax on the gain is $6,000 at 15%. The surtax adds $1,520, for a total of $7,520. A married couple filing jointly with $650,000 of other taxable income and a $200,000 long-term gain pays 20% on all of it. That is $40,000 of income tax plus $7,600 of surtax, for a total of $47,600.

The calculator covers federal tax for 2026 only. It leaves out state income tax, other investment income, qualified dividends, loss carryovers and wash sales, and it assumes the gain is your only investment income. If you live in a state with its own income tax, add the state figure on your own, because the calculator does not estimate it. The calculator is built for stock, exchange-traded fund (ETF) and fund shares in a taxable account. Sales inside a retirement account such as an individual retirement account (IRA) or 401(k) are not taxed this way. If you are selling real estate, use the rental property capital gains calculator. A loss owes no capital gains tax. A single filer who paid $30,000 and sells for $20,000 has a $10,000 loss. Topic 409 limits the net capital loss deduction to $3,000 a year, or $1,500 if married filing separately. Any excess carries forward. You report each sale on Form 8949 and summarize it on Schedule D (Form 1040).

Hold a winning position for more than a year when you can. At $85,000 of other taxable income, a $20,000 gain costs $3,000 held long-term. Sold within a year, the same gain costs $4,400, a $1,400 difference in our internal calculation. A price drop larger than that $1,400 would cost more than the tax you save by waiting. If your other taxable income is under the 0% limit, long-term gains up to the room left in that bracket are tax-free. The calculator shows how much room you have. The 3.8% surtax adds to the bill only for high earners. State income tax, wash-sale or loss-carryover rules, or other investment income you did not enter can change this result. This calculator gives informational estimates rather than tax advice, and a preparer settles the individual case. Before you sell, enter your numbers in the stock capital gains tax calculator above and compare both holding periods.

Frequently asked questions

How is capital gains tax on stock calculated?

Subtract your cost basis from the sale proceeds to get the gain. A long-term gain is stacked on top of your other taxable income and taxed at 0%, 15% or 20% by where it lands. A short-term gain is taxed as ordinary income at graduated rates. High earners may also owe the 3.8% Net Investment Income Tax.

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

The long-term rates are 0%, 15% and 20%. For single filers, the 0% rate covers taxable income up to $49,450. The 15% rate runs to $545,500, and 20% applies above that. Married couples filing jointly get limits of $98,900 and $613,700.

How long do I have to hold a stock to get the long-term rate?

Hold the stock more than one year, per IRS Topic 409, and the gain is long-term. Stock held one year or less produces a short-term gain, which is taxed as ordinary income at graduated rates.

Are short-term stock gains taxed at a higher rate?

They can be, because short-term gains are taxed as ordinary income at graduated rates. A single filer with $85,000 of other taxable income pays $4,400 on a $20,000 short-term gain. Held more than one year, the same gain costs $3,000.

What is the Net Investment Income Tax on a stock sale?

The Net Investment Income Tax is a 3.8% surtax described in IRS Topic 559. It applies to the smaller of your net investment income or your modified adjusted gross income (MAGI) above a threshold. The threshold is $200,000 for single or head of household filers and $250,000 for joint filers. It is $125,000 if married filing separately.

Can I owe no tax when I sell stock?

Yes, if your long-term gain fits inside the 0% bracket. A single filer with $20,000 of other taxable income owes $0 on a $5,000 long-term gain. A sale at a loss also owes no capital gains tax.

What happens if I sell stock at a loss?

A loss owes no capital gains tax. Under IRS Topic 409, you can deduct up to $3,000 of net capital loss a year, or $1,500 if married filing separately. Any excess carries forward.

How do I find my cost basis?

Your cost basis is usually the purchase price plus commissions and recording or transfer fees, per IRS Topic 703. Check your brokerage records for the price you paid and the fees charged. The calculator does not check basis, so the result depends on the figure you enter.

Sources

We prioritize primary sources for rules, formulas, rates, limits, and definitions. See our calculator methodology and editorial policy.

Plan the bigger picture