Tax guide
How to Use a Capital Gains Tax Calculator
How to calculate capital gains tax for 2026: basis, short- versus long-term rates, the 0%, 15% and 20% bands, the 3.8% NIIT, and a worked example.
Quick answer
What this calculator tells you
A capital gains tax calculator estimates the federal tax you owe when you sell an asset for more than your basis. The tax depends on three things: how big the gain is after your costs, whether you held the asset for more than a year, and how much other taxable income you have, because the gain is stacked on top of it. The Loan Lyze calculator applies the 2026 federal rules for each of those.
This guide walks through the calculation step by step, shows the 2026 long-term thresholds, compares a short-term and a long-term sale of the same asset, and explains the 3.8% Net Investment Income Tax. Every example uses the calculator's default inputs, so you can open the tool and reproduce each figure. It is a federal estimate for one sale, not a tax return.
Inputs that matter most
Start with documents rather than memory whenever possible. For this calculation, pay particular attention to:
- sale price and adjusted basis
- holding period: short-term or long-term
- other taxable income and filing status
- state tax, depreciation recapture, and losses, which are not modeled
Use values that describe the same point in time. Mixing an old balance with a new rate or an annual cost with a monthly figure can make a polished result unreliable.
When this calculator is most useful
Use this tool early enough to improve the decision, but late enough that the inputs are grounded in real information. It is particularly useful when:
- You are thinking of selling stock, a fund, or other property and want to estimate the federal tax before you decide.
- You want to see how much waiting past one year would save by turning a short-term gain into a long-term one.
- You want to know how much of a gain would fall in the 0%, 15%, or 20% band given your other income.
- You want to check whether the 3.8% Net Investment Income Tax could apply to your sale.
It is less useful when the key facts are unknown, the options use different time periods, or the decision turns mainly on eligibility, contract language, taxes, or risks the calculator does not model. In those situations, gather the missing documents first and treat any early result as a rough range.
How the calculation works
The model turns the entered assumptions into a consistent comparison. It does not fill in facts that were not requested, predict changing markets, or reproduce an institution's underwriting system. That boundary matters: mathematical precision is not the same thing as certainty.
How the tax is built, step by step
The calculator follows the same order a tax return does. Starting from your sale:
- Adjusted basis = original cost + improvements + selling costs.
- Realized gain = sale price − adjusted basis.
- Recognized gain = realized gain − any eligible exclusion you enter, never below zero.
- Long-term gain is stacked on top of your other taxable income and taxed at 0%, 15%, or 20%. Short-term gain is added to other taxable income and taxed at ordinary rates.
- The 3.8% Net Investment Income Tax is added if your modified adjusted gross income plus the gain exceeds the threshold for your filing status.
Selling costs are added to basis here, which has the same effect as subtracting them from the sale price. If the recognized gain is zero or negative, the calculator shows no tax; it does not model loss carryovers.
2026 long-term rates and thresholds
Long-term gains are taxed at 0%, 15%, or 20% depending on taxable income, and your gain counts toward these limits. The 2026 amounts, from the IRS bulletin linked in the source note, are:
- Single: 0% up to $49,450 of taxable income, 15% up to $545,500, 20% above.
- Married filing jointly: 0% up to $98,900, 15% up to $613,700, 20% above.
- Head of household: 0% up to $66,200, 15% up to $579,600, 20% above.
- Married filing separately: 0% up to $49,450, 15% up to $306,850, 20% above.
These thresholds are in terms of taxable income, which includes the gain itself. That is why the same gain can be taxed at different rates depending on your other income.
Short-term versus long-term, same sale
The holding period changes the rate more than almost any other input. A gain on an asset held for more than one year is long-term; one year or less is short-term. Take the default sale, a $95,000 gain with $60,000 of other taxable income, single filer:
- Long-term: all $95,000 falls in the 15% band, so the tax is $14,250, an effective rate of 15%.
- Short-term: the gain is added to ordinary income and taxed through the ordinary brackets, for about $21,886, an effective rate of about 23.0%.
Waiting past the one-year mark would save about $7,636 on this sale. That is a reason to check your purchase date before you sell, though it should be weighed against the risk of holding the asset longer.
Bracket stacking and the 3.8% surtax
Because the gain sits on top of your other income, the same $95,000 long-term gain costs different amounts depending on what else you earned. Single filer, default sale, changing only other taxable income:
- $20,000 of other income: $29,450 of the gain is at 0% and $65,550 at 15%, for a tax of about $9,833.
- $40,000: $9,450 at 0% and $85,550 at 15%, for about $12,833.
- $60,000 (the default): all $95,000 at 15%, for $14,250.
- $500,000: $45,500 at 15% and $49,500 at 20%, plus about $3,610 of surtax, for about $20,335.
Filing status matters too. A married couple filing jointly with the same $60,000 of other income would have $38,900 of the gain at 0% and pay about $8,415. The surtax can also appear at lower incomes when the gain is large: with no basis additions the gain is $130,000, modified adjusted gross income plus the gain reaches $205,000, and the surtax adds about $190.
Worked example
See the method in context
Suppose a single filer sells an investment for $350,000. They originally paid $220,000, added $15,000 of improvements, and paid $20,000 in selling costs, so adjusted basis is $255,000 and the gain is $95,000. They held the asset for more than a year, their other taxable income is $60,000, and their modified adjusted gross income is $75,000.
Their other income already exceeds the $49,450 limit of the 0% band, so the whole gain falls in the 15% band and the tax is $14,250, or 15%. The 3.8% surtax does not apply because $75,000 plus $95,000 is below $200,000. After tax, they keep about $80,750 of the gain.
After running the base case, change one important input at a time. A less favorable rate, cost, return, income, or holding period shows whether the conclusion is sturdy or depends on a narrow set of assumptions.
Build three scenarios, not one prediction
A single answer can create false confidence. Three deliberately different cases reveal both the likely range and the assumptions that deserve more investigation.
Conservative case
Raise your other taxable income to see how a higher bracket changes the bill. With the default $95,000 gain, other taxable income of $500,000 puts part of the gain in the 20% band and triggers the 3.8% surtax, taking the tax from $14,250 to about $20,335.
Expected case
Enter your real figures: the sale price, what you paid, documented improvements and selling costs, your taxable income after deductions excluding this gain, and your modified adjusted gross income. Choose long-term only if you held the asset for more than one year.
Improved case
Change only the holding period or the basis. Treating the default sale as long-term instead of short-term lowers the tax from about $21,886 to $14,250, a saving of about $7,636, and documenting an extra $35,000 of basis would lower it by about $5,440.
Keep all unchanged inputs identical across the three runs. That discipline makes the comparison explainable and prevents several moving assumptions from hiding what actually changed the answer.
How to read the result
Look beyond the largest number on the screen. Review the breakdown, the time horizon, and any balance or cost that remains at the end of the comparison. Ask whether the result still fits cash flow and whether it changes under a conservative scenario.
The estimate covers 2026 federal tax on one sale; state tax, special rates, loss carryovers, and your full return can change what you actually owe. The right next step is to confirm your basis and holding period from your records, then check the result against IRS guidance or a tax professional before you sell.
Common mistakes to avoid
- Forgetting basis additions. Improvements and selling costs lower your gain; leaving them out, as in the $35,000 of additions here, raises the tax by about $5,440.
- Selling too early. A gain on an asset held for one year or less is short-term and taxed at ordinary rates, which in the default example costs about $7,636 more.
- Entering salary instead of taxable income. The bands depend on taxable income after deductions, excluding the gain, so using gross pay places the gain too high.
- Assuming every dollar of gain is taxed at the top rate. Only the part that falls above each threshold is taxed at the higher rate; with $20,000 of other income, $29,450 of the default gain is taxed at 0%.
- Overlooking the 3.8% surtax. A large gain can push modified adjusted gross income over the threshold, as when no basis additions raise the gain to $130,000 and the surtax adds about $190.
- Entering an exclusion you have not confirmed. The calculator does not check eligibility; enter one only if you have confirmed you qualify.
Decision checklist
Before acting, work through these questions. A “no” does not automatically reject the option; it identifies where more evidence or a wider safety margin is needed.
- 1Do I know my adjusted basis, including what I paid, improvements, and selling costs, and can I support each figure with records?
- 2Have I held the asset for more than one year? Selling one year or less after acquiring it makes the gain short-term.
- 3Did I enter my taxable income after deductions, excluding this gain, and not my salary or gross income?
- 4Could my modified adjusted gross income plus this gain cross the Net Investment Income Tax threshold for my filing status?
- 5Have I considered what the estimate leaves out: state tax, special rates, depreciation recapture, wash sales, and loss carryovers?
Key terms in plain English
- Adjusted basis
- What the asset cost you, plus improvements, plus selling costs, in this calculator. Subtracting it from the sale price gives your gain, so a higher documented basis means a smaller taxable gain.
- Recognized gain
- The gain that is actually taxed: the sale price minus adjusted basis, minus any eligible exclusion you enter. If it is zero or negative, the calculator shows no gain tax.
- Bracket stacking
- Your gain is added on top of your other taxable income, so the rate on each slice depends on where that slice falls. Low other income leaves room in the 0% band; high other income pushes the gain into the 15% or 20% band.
- Net Investment Income Tax (NIIT)
- An extra 3.8% federal tax on the lesser of your net investment income or the amount by which your modified adjusted gross income exceeds a filing-status threshold: $200,000 for single and head of household, $250,000 for married filing jointly, $125,000 for married filing separately.
Frequently asked questions
How do you calculate capital gains tax?
Subtract your adjusted basis from the sale price to get the gain. Adjusted basis is what you paid plus improvements and selling costs. Subtract any exclusion you qualify for to get the recognized gain. If you held the asset more than a year, the gain is taxed at 0%, 15%, or 20% depending on your taxable income; otherwise it is taxed at your ordinary rates. With the defaults, $350,000 − $255,000 = $95,000 of gain and $14,250 of tax.
What are the 2026 long-term capital gains tax rates?
The rates are 0%, 15%, and 20%, set by taxable income. For a single filer in 2026, the 0% rate applies up to $49,450 of taxable income and the 15% rate up to $545,500, with 20% above that. For married filing jointly the limits are $98,900 and $613,700; for head of household $66,200 and $579,600; for married filing separately $49,450 and $306,850. Your gain counts toward these amounts.
What is the difference between short-term and long-term capital gains?
A gain is long-term if you held the asset for more than one year and short-term if you held it for one year or less. Long-term gains get the lower 0%, 15%, and 20% rates. Short-term gains are taxed as ordinary income. With the defaults, the same $95,000 gain costs about $14,250 as long-term and about $21,886 as short-term.
How do improvements and selling costs affect capital gains tax?
They raise your basis, which lowers your gain. In the defaults, $220,000 of original cost plus $15,000 of improvements and $20,000 of selling costs gives a $255,000 basis and a $95,000 gain. Without the $35,000 of additions the gain would be $130,000 and the tax would be about $19,690, roughly $5,440 more.
What is the 3.8% Net Investment Income Tax?
It is an extra 3.8% federal tax on the lesser of your net investment income or the amount by which your modified adjusted gross income exceeds $200,000 for single and head of household filers, $250,000 for married filing jointly, or $125,000 for married filing separately. In the defaults it does not apply, because $75,000 plus the $95,000 gain is below $200,000; with other taxable income of $500,000 it adds about $3,610.
Do capital losses reduce my capital gains tax?
Losses can offset gains, but this calculator does not model loss netting or carryovers. If you enter a sale price below your basis, it shows no gain and no tax. If you have losses from other sales, reduce the gain yourself before you enter it, and check IRS guidance on how losses apply to your return.
What does the capital gains tax calculator leave out?
It estimates 2026 federal tax on one sale. It does not include state or local tax, depreciation recapture, collectibles or qualified small business stock rates, installment sales, wash sales, or capital loss carryovers, and it does not check whether an exclusion you enter is one you qualify for. Treat the result as an estimate and confirm with a tax professional.
Source and editorial note
For current background, review IRS Internal Revenue Bulletin 2025-45: 2026 capital gain rate thresholds (Rev. Proc. 2025-32). Official rules and product documents control when they differ from this educational explanation.
Need help with unfamiliar language? Use the financial calculator glossary for definitions and links to related tools.
Prepared by Loan Lyze Editorial under our editorial policy. This article explains a calculator; it is not financial, tax, legal, insurance, or investment advice.