Skip to content
Budget Folders

Capital gains tax calculator

A single filer with $85,000 of other income who sells stock at a $30,000 long-term gain owes about $4,500 in federal tax for 2026. The same gain held one year or less costs $6,600. Your rate depends on your income, how long you held the asset, and what you sold.

Edited by AnilReviewed How we calculateEditorial policy

Your numbers
Start from an example
The sale
You
More options (4)
Stays in your browser
Capital Gains Tax Calculator
Estimated tax on this sale
$4,500
2026 rates. Federal income tax added by this sale.
Where your $30,000 gain goes
  • You keep$25,500
  • Federal income tax$4,500
Gain on the sale
$30,000
Federal income tax
$4,500
Long-term rates
Net investment income tax
$0
3.8% above $200,000 of modified AGI
State tax
$0
At 0%
Tax rate on your gain
15%
Total tax divided by the whole gain
Left after tax
$55,500
Sale price less costs and tax, before any loan payoff

What this means

  • Long-term gains stack on top of your other taxable income of $68,900. This gain lands as $30,000 at 15%. The lower bands fill up first, so the rate depends on your income as well as the gain.
  • Holding for more than one year saves $2,100: the same gain as short-term would cost $6,600.
  • No state tax is included. Your state may tax this gain, so enter its rate under "State tax rate" to see the full bill. The state income tax calculator can help you find it.
  • A large gain can mean you need to make an estimated tax payment. IRS Publication 505 explains the rules and the underpayment penalty.

What moves this number

Change in estimated tax on this sale. Select one to try it.

Total tax as the gain grows
For your income and filing status, after your losses and any exclusion
  • Long-term
  • Short-term
$0$10K$20K$30K$0K$20K$40K$60K$80K$100K
View as table
Taxable gainLong-termShort-term
$0K$0$0
$10K$1,500$2,200
$20K$3,000$4,400
$30K$4,500$6,600
$40K$6,000$8,864
$50K$7,500$11,264
$60K$9,000$13,664
$70K$10,500$16,064
$80K$12,000$18,464
$90K$13,500$20,864
$100K$15,000$23,264

Keep going with these numbers

How your federal income tax on this sale is built

The amounts cover this sale and any losses you entered. The tax column adds up to the federal income tax shown above.

PortionAmountFederal tax
15% band, income up to $545,500$30,000$4,500

The same gain, short-term or long-term

HeldFederal income taxNIITStateTotal
One year or less$6,600$0$0$6,600
More than one year$4,500$0$0$4,500

What a harvested long-term loss would do

Each row adds a new long-term loss on top of what you entered. Net losses above $3,000 a year can't reduce other income and carry forward instead. A negative total means the loss also cuts tax on your other income.

New lossTotal taxTax savedCarried forward
$3,000$4,050$450$0
$10,000$3,000$1,500$0
$25,000$750$3,750$0
$30,000$0$4,500$0
$33,000-$660$5,160$0
$55,000-$660$5,160$22,000

2026 limits for your filing status

RuleAmount
0% long-term rate, taxable income up to$49,450
15% long-term rate, taxable income up to$545,500
Net investment income tax, modified AGI above$200,000
Standard deduction$16,100
Net capital loss against other income, per year$3,000
Home sale exclusion, if you qualify$250,000

What is the capital gains tax rate for 2026?

Long-term gains are taxed at 0%, 15%, or 20%, based on your taxable income including the gain. Short-term gains on assets held one year or less are taxed at your regular income tax rates. For 2026, a single filer pays 0% on long-term gains up to $49,450 of taxable income, and 20% only above $545,500.

2026 long-term capital gains bands by taxable income, from IRS Rev. Proc. 2025-32, and the net investment income tax threshold.
Filing status0% up to15% up to20% above3.8% NIIT above
Single$49,450$545,500$545,500$200,000
Married filing jointly$98,900$613,700$613,700$250,000
Head of household$66,200$579,600$579,600$200,000
Married filing separately$49,450$306,850$306,850$125,000

A qualifying surviving spouse uses the married filing jointly bands. Collectibles and qualified small business stock can reach 28%, and gain from depreciation on real estate can reach 25%. This tool covers the 25% case but not the 28% one. The net investment income tax, or NIIT, adds 3.8% above the modified AGI thresholds in the table, which aren't indexed for inflation.

How is capital gains tax calculated?

First find your gain. Then place it on top of your other taxable income and see which bands it fills.

Gain = sale price − selling costs − (what you paid + improvements − depreciation)

Say you're single with $46,100 of other income. After the $16,100 standard deduction, $30,000 is ordinary taxable income. A $40,000 long-term gain sits on top. The first $19,450 fills the rest of the 0% band, and the remaining $20,550 is taxed at 15%, for $3,083 of tax. The gain doesn't push your wages into a higher rate, but your wages do push the gain up the bands.

Federal tax added by a $50,000 long-term gain, by other income. Standard deduction, 2026 rates, NIIT included. Calculated by this site.
Other incomeSingleMarried filing jointlyHead of householdMarried filing separately
$30,000$2,168$0$0$2,168
$60,000$6,668$0$2,948$6,668
$100,000$7,500$2,835$7,500$8,450
$200,000$9,400$7,500$9,400$9,400
$400,000$9,400$9,400$9,400$11,900
$700,000$11,900$11,900$11,900$11,900

Adding qualified improvements to your basis lowers the gain. A new roof counts, but ordinary repairs generally don't. Inherited assets usually take a basis equal to fair market value on the date of death, as IRS Publication 551 explains, which can shrink a gain a great deal. That's why "what you paid" may be the wrong number for an inherited house or stock.

Long-term capital gains: how long do you have to hold?

More than one year. Count from the day after you got the asset, through the day you sold it. Sell on or before the one-year mark and the gain is short-term. In the opening example, waiting past a year saves $2,100. The saving depends on your income, as this table shows.

Federal tax on a $30,000 gain, single filer, standard deduction. NIIT included where it applies.
Other incomeHeld 1 year or lessHeld more than 1 yearSaved by waiting
$30,000$3,600$0$3,600
$60,000$5,950$3,668$2,283
$100,000$6,764$4,500$2,264
$200,000$9,310$5,640$3,670
$400,000$11,640$5,640$6,000
$700,000$12,240$7,140$5,100

Do you pay capital gains tax on the sale of a house?

Often not on your main home. You can exclude up to $250,000 of gain, or $500,000 for a married couple filing jointly, if you pass these tests from IRS Publication 523:

  • Ownership: you owned the home at least 24 months of the last 5 years. On a joint return, one spouse is enough.
  • Residence: you lived in it at least 24 months of the last 5 years. For the full joint limit, both spouses must pass.
  • Look-back: you did not exclude gain on another home in the 2 years before this sale.
Taxable gain and federal tax on a main home sale, with $100,000 of other income and all tests passed. The excluded part isn't subject to NIIT.
GainSingle: taxableSingle: taxJoint: taxableJoint: tax
$200,000$0$0$0$0
$300,000$50,000$7,500$0$0
$500,000$250,000$43,200$0$0
$700,000$450,000$80,800$200,000$27,235
$1,000,000$750,000$151,620$500,000$83,635

If you miss a test but sold mainly because of work, health, or an unforeseeable event, you may get a reduced exclusion. Twelve months out of 24 gives a single filer a limit of $125,000. You can't deduct a loss on your main home, and any part of the gain from depreciation stays taxable. Gain tied to periods after 2008 when it wasn't your main home, such as time as a second home, can't be excluded, which this tool doesn't model.

How much is capital gains tax on a rental or second home?

No home sale exclusion applies, and NIIT often does. Depreciation adds another layer, because it lowers your basis and raises the gain. That part is called unrecaptured section 1250 gain, taxed at your regular rate up to 25%. A married couple with $120,000 of other income and a $240,000 gain, including $70,000 from depreciation, pays $39,600 of federal income tax, against $34,335 with no depreciation in the gain, plus $4,180 of NIIT.

A large gain can trigger NIIT even if your income is normally below the line. A single filer with $150,000 of income and a $200,000 long-term gain owes $5,700 of NIIT on it. Before selling a rental, a CPA or enrolled agent can check recapture, section 1031 exchanges, and the installment method. The rental property calculator can help with the numbers before you sell.

Can capital losses lower my tax? What harvesting a loss saves

Yes. Losses offset gains first. If losses are larger, up to $3,000 a year ($1,500 if married filing separately) can reduce other income, and the rest carries forward. For a single filer with $100,000 of income and a $30,000 long-term gain:

Base tax on the gain alone: $4,500. Calculated by this site.
Loss takenTax after lossTax savedCarried forward
$5,000$3,750$750$0
$15,000$2,250$2,250$0
$30,000$0$4,500$0
$50,000-$660$5,160$17,000

The trap: buying the same or a substantially identical security within 30 days before or after the sale is a wash sale, and the loss is disallowed for now. And a loss used against a gain already at 0% saves nothing. A single filer with $40,000 of income and a $20,000 gain owes $0, and a $5,000 loss leaves the tax at $0.

Gains can also affect things this tool doesn't count, such as Medicare premiums, health insurance credits, and state tax. Enter your state rate above, or use the state income tax calculator. States differ, so check your state revenue department. If you owe a lot, you may also need to make an estimated tax payment.

Common questions

Do I pay capital gains tax if I reinvest the money?

Generally yes. Selling triggers the gain, whatever you do with the cash. Exceptions exist, such as a section 1031 exchange of investment real estate, and trades inside a retirement account are not taxed this way.

Is the 0% capital gains rate real?

Yes, for long-term gains within the 0% band. For 2026, that band runs up to $49,450 of taxable income for a single filer and $98,900 on a joint return, including the gain itself. Your state may still tax it.

Do I pay net investment income tax on my home sale?

Not on the excluded part. Any taxable gain above the exclusion counts as investment income and can trigger the tax if your modified AGI passes your threshold.

Do you pay capital gains tax on inherited property?

Only on gain above your basis. That basis is generally the fair market value on the date of death, or on the alternate valuation date if one is used, so enter that as what you paid. If an estate tax return was filed, the value reported to you may set your basis. Publication 551 has the details.

What does capital gains tax look like in California or another state?

This tool doesn't store state rules. Enter the rate your state applies to this gain. It's applied flat to your net taxable gain, which is an estimate, since a large gain can reach several state brackets.

Sources

  1. Topic no. 409: Capital gains and losses · Internal Revenue Service
  2. Publication 523: Selling Your Home · Internal Revenue Service
  3. Questions and answers on the Net Investment Income Tax · Internal Revenue Service
  4. Instructions for Schedule D (Form 1040) · Internal Revenue Service
  5. Revenue Procedure 2025-32 · Internal Revenue Service
  6. Publication 551: Basis of Assets · Internal Revenue Service

More in Taxes & Pay