Open Capital Gains Tax Calculator →
Selling a stock, a rental property or a piece of land usually feels like a win until the tax question shows up. How much of the profit do you actually keep? A capital gains tax calculator answers that before you sell, when you can still change the timing, offset the gain with losses or decide that holding a few more weeks is worth it. This guide explains how the tax works in 2026, shows the exact rate thresholds, and walks through examples you can verify by hand.
What a capital gains tax calculator does
A capital gains tax calculator takes your profit, your other income and how long you owned the asset, then estimates the federal tax, the 3.8% Net Investment Income Tax (NIIT) and your state tax. Some people search for it as a calculator capital gains tax tool or a tax on capital gains calculator, but the job is the same: profit in, estimated tax out.
Our capital gains tax calculator uses the 2026 long-term rate breakpoints from IRS Rev. Proc. 2025-32 and the NIIT rules in IRC Section 1411, and it includes a state estimate for all 50 states and D.C. You enter four things: your filing status, your net realized capital gain, your other taxable income (after deductions) and whether the holding period was long-term or short-term.
How is capital gains tax calculated?
If you want to know how to calculate capital gains tax without software, follow these five steps. The same logic sits behind any tool for calculating capital gains tax.
- Find your cost basis. This is usually what you paid, plus purchase fees and the cost of improvements for real estate. For inherited assets the basis is generally the market value at the date of death, and for gifts it generally carries over from the giver.
- Calculate the gain. Subtract the adjusted basis (and selling costs) from the sale price.
- Check the holding period. More than one year is long-term. One year or less is short-term.
- Net your gains and losses. Losses on other sales offset gains. If losses are larger, up to $3,000 can reduce other income each year and the rest carries forward.
- Apply the rate, then add NIIT and state tax. Long-term gains use the 0%, 15% or 20% tiers. Short-term gains are taxed as ordinary income.
Long term capital gains tax calculator: 2026 rates
A long term capital gains tax calculator uses three federal rates. The rate depends on your total taxable income, including the gain, and your filing status. Here are the 2026 breakpoints.
| Rate | Single | Married Filing Jointly | Head of Household | Married Filing Separately |
|---|---|---|---|---|
| 0% | Up to $49,450 | Up to $98,900 | Up to $66,200 | Up to $49,450 |
| 15% | $49,451 to $545,500 | $98,901 to $613,700 | $66,201 to $579,600 | $49,451 to $306,850 |
| 20% | Over $545,500 | Over $613,700 | Over $579,600 | Over $306,850 |
These breakpoints apply to taxable income, which is income after deductions. A Single filer who takes the 2026 standard deduction of $16,100 can therefore have up to about $65,550 of total income, gain included, and still pay 0% on the gain. Long-term gains are stacked on top of your ordinary income, so only the portion of the gain that falls above a breakpoint is taxed at the higher rate.
Example: how the stacking works
A Single filer has $40,000 of taxable income before the gain and a $20,000 long-term gain. The first $9,450 of the gain fits under the $49,450 zero-rate line and is taxed at 0%. The remaining $10,550 is taxed at 15%, which is $1,582.50 of federal tax on a $20,000 gain, an effective rate of about 7.9%.
Short term capital gains tax calculator: ordinary income rates
A short term capital gains tax calculator works differently because there is no preferential rate. Gains on assets held one year or less are added to your wages and other income and taxed at your marginal bracket, which ranges from 10% to 37% in 2026. For many working households that means 22% or 24%. Our calculator stacks a short-term gain on top of your other taxable income and applies the actual 2026 brackets.
The gap can be large. On a $10,000 gain, a 15% long-term rate costs $1,500 in federal tax, while a 22% short-term rate costs $2,200. If you are close to the one-year mark, checking the exact purchase date before you sell can save real money.
Stock capital gains tax calculator: what to enter
A stock capital gains tax calculator needs your sale proceeds and your adjusted cost basis. Subtract one from the other and enter the net gain. A few details matter:
- Reinvested dividends increase your basis, which lowers your gain.
- Multiple lots can have different purchase dates, so some shares may be long-term while others are short-term.
- The wash sale rule disallows a loss if you buy the same or a substantially identical security within 30 days before or after the sale.
- Retirement accounts such as a 401(k) or IRA are not taxed on trades inside the account, so capital gains rules do not apply there.
For stock sales where you want to enter proceeds and basis separately, use the stock tax calculator. For qualified dividends, which share the same 0%, 15% and 20% rates, try the dividend tax calculator, and for digital assets use the crypto tax calculator.
The 3.8% Net Investment Income Tax
Higher earners can owe an extra 3.8% on investment income. The tax applies to the lesser of your net investment income or the amount your modified adjusted gross income (MAGI) exceeds the threshold for your filing status.
| Filing status | MAGI threshold |
|---|---|
| Single / Head of Household | $200,000 |
| Married Filing Jointly | $250,000 |
| Married Filing Separately | $125,000 |
These thresholds are set by statute and are not indexed for inflation, so more taxpayers cross them each year.
Worked examples from the calculator
These three examples use the inputs and logic of our capital gains tax calculator. The first two use California as the state, which is the calculator's default.
| Scenario | Federal rate | NIIT | State tax | Total estimate |
|---|---|---|---|---|
| $85,000 long-term gain, $45,000 other income (CA) | 0% and 15% ($12,083) | $0 | $7,642 | $19,725 |
| $85,000 short-term gain, $45,000 other income (CA) | 12% to 24% ($18,646) | $0 | $7,642 | $26,288 |
| $300,000 long-term gain, $150,000 other income (federal only) | 15% ($45,000) | $10,112 | Varies | $55,112 federal |
The first two rows show the cost of selling too early: the same $85,000 gain costs $6,563 more in federal tax when it is short-term. In the third row, the calculator estimates MAGI by adding the $16,100 standard deduction back to $450,000 of taxable income, which gives $466,100. That is $266,100 over the $200,000 NIIT threshold, so 3.8% applies to $266,100 of the gain, which is $10,112.
What the calculator simplifies
No online estimate replaces a tax return, so it helps to know the assumptions. Our calculator asks for your other taxable income after deductions, stacks the gain on top and applies the 2026 breakpoints for Single, Married Filing Jointly or Head of Household. It does not net your losses for you, and it estimates MAGI for the NIIT by adding back the standard deduction. Special rates also exist outside the calculator: collectibles can be taxed up to 28%, and unrecaptured gain on depreciated real estate up to 25%.
Capital gains tax on real estate and home sales
Property follows the same basic rules, with one big exception. If you owned and used a home as your main residence for at least two of the five years before the sale, you can exclude up to $250,000 of gain, or $500,000 for most married couples filing jointly (IRC Section 121). Gain above the exclusion is taxed like any other long-term gain. Investment and rental property do not get the exclusion, and depreciation you claimed can be taxed at up to 25%. For rental owners, the rental income tax calculator covers the income side.
How your state changes the result
Federal tax is the same everywhere. State tax is what varies. Most states with an income tax tax capital gains as ordinary income, a few offer partial exclusions, and states without an income tax, such as Texas and Florida, do not tax the gain as income. Washington is a notable exception with a separate excise tax on certain large long-term gains. California, for example, has no lower rate for long-term gains, which is why the calculator shows $7,642 of state tax on an $85,000 gain.
How to use the capital gains tax calculator
- Open the capital gains tax calculator and choose your state.
- Enter your net realized capital gain (proceeds minus cost basis).
- Choose your filing status and enter your other taxable income for the year, after deductions.
- Select Long-Term (more than one year) or Short-Term (one year or less).
- Read the federal rate, NIIT and state tax in the breakdown.
Run it twice to compare selling now against waiting past the one-year mark, or selling this year against next year when your income may be lower.
Practical ways to lower your capital gains tax
- Hold for more than one year so the gain qualifies for long-term rates.
- Harvest losses by selling losing positions to offset gains, while watching the 30-day wash sale rule.
- Use low-income years. If your taxable income is under the 0% breakpoint, selling appreciated assets that year can cost nothing federally.
- Use retirement accounts for frequent trading, since gains inside them are not taxed each year.
- Track your basis carefully, including reinvested dividends and improvement costs.
For large sales, a licensed tax professional can review your full situation, including state rules and any special rates.
Informational estimate: This article and the linked calculator provide general estimates for education only. They are not legal, tax or accounting advice. Figures reflect Tax Year 2026 federal data (IRS Rev. Proc. 2025-32) as used in our calculator; confirm your exact tax with a qualified tax professional or the IRS.