- Home
- Calculators
- Capital Gains Tax Calculator
Capital gains tax calculator: estimate the tax before you sell
Reviewed by a licensed financial advisor
Estimate the federal and state tax on the sale of stocks, funds, property or other investments, using the 2026 and 2027 long-term and short-term rates.

Enter your numbers
Type a value or drag the slider. Your results update instantly.
Your results
On this page
- How to use this capital gains tax calculator
- Long-term capital gains tax rates
- Short-term capital gains
- Ways to reduce capital gains tax
- A worked example
- How other income changes the tax
- Short-term vs. long-term
- Filing status and state tax
- A larger sale
- Ways to reduce the tax
- Getting your cost basis right
- What the calculator leaves out
- Common mistakes
- Next steps
- Frequently asked questions
How to use this capital gains tax calculator
Enter what you paid for the asset, including commissions and improvements, and what you expect to sell it for. Add your other taxable income for the year, after deductions. Set filing status to 1 for single or 2 for married filing jointly, and the holding period to 1 if you owned the asset for more than a year. Choose the tax year of the sale and your state’s rate. The capital gains tax calculator shows the gain, the federal and state tax, and what you keep.
Long-term capital gains tax rates
Assets held longer than one year are taxed at 0%, 15% or 20%. The rate depends on your total taxable income, including the gain.
| Rate | 2026 single | 2026 married filing jointly | 2027 single | 2027 married filing jointly |
|---|---|---|---|---|
| 0% | Up to $49,450 | Up to $98,900 | Up to $51,050 | Up to $102,100 |
| 15% | $49,451 to $545,500 | $98,901 to $613,700 | $51,051 to $563,200 | $102,101 to $633,600 |
| 20% | Over $545,500 | Over $613,700 | Over $563,200 | Over $633,600 |
The gain is stacked on top of your other income. A single filer with $40,000 of other taxable income and a $30,000 long-term gain in 2026 pays 0% on the first $9,450 of the gain and 15% on the remaining $20,550, for about $3,083 of federal tax. High earners may also owe the 3.8% net investment income tax once income passes $200,000, or $250,000 for joint filers. The calculator adds an estimate of it when it applies.
Short-term capital gains
Gains on assets held one year or less are taxed as ordinary income, at rates from 10% to 37%. Using the example numbers above, the $40,000 gain costs $6,000 in federal tax if held long term and about $9,186 if sold short term. Waiting until the one-year mark can make a real difference.
Planning for the whole year? Read our tax planning guide.
Ways to reduce capital gains tax
- Hold for more than a year to qualify for long-term rates.
- Harvest losses. Losses offset gains, plus up to $3,000 of ordinary income a year, and the rest carries forward.
- Time the sale. Selling in a lower-income year can keep more of the gain in the 0% or 15% band.
- Use the home sale exclusion. Up to $250,000 of gain on a primary residence, or $500,000 for joint filers, can be excluded if you meet the ownership and use tests.
- Give appreciated assets. Donating shares to charity avoids the gain entirely.
A worked example with the default numbers
The calculator starts with an asset bought for $50,000 and sold for $90,000, held longer than a year, by a single filer with $85,000 of other taxable income in 2026 and a 5% state tax rate. The capital gain is $40,000. Because the filer’s other income is already above the top of the 0% bracket ($49,450 for single filers in 2026), the entire gain is taxed at 15% federally, which is $6,000. State tax at 5% is $2,000. The total is $8,000, which is 20% of the gain, and the seller keeps $82,000 of the $90,000 sale price.
The calculator stacks the gain on top of your other income, so the same sale can be taxed at a different rate depending on what else you earned that year. That is the key idea behind the rest of this page.
How your other income changes the tax
Keeping the same $40,000 long-term gain and 5% state rate, here is what happens as other taxable income changes (single filer, 2026):
| Other taxable income | Federal tax | Net investment income tax | Total tax | Share of gain |
|---|---|---|---|---|
| $30,000 | $3,082 | $0 | $5,082 | 12.7% |
| $60,000 | $6,000 | $0 | $8,000 | 20.0% |
| $85,000 | $6,000 | $0 | $8,000 | 20.0% |
| $150,000 | $6,000 | $0 | $8,000 | 20.0% |
| $300,000 | $6,000 | $1,520 | $9,520 | 23.8% |
At $30,000 of other income, part of the gain falls in the 0% bracket. Between roughly $50,000 and several hundred thousand dollars, the federal rate is 15%. At $300,000 the 3.8% net investment income tax applies to the part of income over $200,000, which adds $1,520 here. Federal tax does not change between $60,000 and $150,000 because the gain stays within the 15% bracket across that range.
Short-term compared with long-term
The same $40,000 gain sold after holding for one year or less is taxed as ordinary income. With $85,000 of other income, the federal tax rises from $6,000 to $9,186, and the total including state tax rises from $8,000 to $11,186, or 28% of the gain. At $150,000 of other income, the short-term federal tax is $9,600. Waiting past the one-year mark on this sale would save about $3,186. If you are a few weeks from one year, check the exact date the holding period is measured from before you sell.
Filing status and state tax
Married couples filing jointly get wider brackets. The same $40,000 gain with $85,000 of other income and a joint return has $3,915 of federal tax instead of $6,000, because part of it falls into the 0% bracket (which extends to $98,900 for joint filers in 2026). Total tax with a 5% state rate is $5,915, or 14.8% of the gain. With $60,000 of other income, joint filers owe only $165 of federal tax and $2,165 in total.
State tax makes a visible difference too. On the $40,000 gain, a state with no income tax leaves the total at $6,000 (15%), a 5% state makes it $8,000 (20%) and a 9% state makes it $9,600 (24%). Enter your own state rate, since some states tax capital gains differently from ordinary income.
A larger sale
Consider a $100,000 investment sold for $500,000 by a single filer with $150,000 of other income. The gain is $400,000. Federal tax is about $60,225, the net investment income tax adds about $13,300, and a 5% state tax adds $20,000, for a total near $93,525, or 23.4% of the gain. Part of the gain is taxed at 20% because it passes the top of the 15% range. Large sales are where planning has the most value, since spreading a sale across tax years can keep more of the gain in lower brackets.
Ways people reduce capital gains tax
- Hold for more than a year. The long-term rates are lower than ordinary rates.
- Sell in a lower-income year. A year with a career break, retirement or a gap between jobs can place more of the gain in the 0% bracket.
- Harvest losses. Losses offset gains, and net losses can offset up to $3,000 of ordinary income a year, with the rest carried forward. The wash-sale rule disallows a loss if you buy the same or a substantially identical investment within 30 days before or after the sale.
- Donate appreciated assets. Giving appreciated shares you have held more than a year to charity can avoid the gain, and you may be able to deduct the value.
- Use tax-advantaged accounts. Gains inside an IRA or 401(k) are not taxed in the year of the sale.
- Choose which shares to sell. If you bought at different prices, selling higher-cost shares first can reduce the gain. Ask your broker whether specific lot selection is available.
Getting your cost basis right
Your cost basis is what you paid, plus commissions and, for property, improvements. Reinvested dividends add to basis, which many people forget, so the same dollars are not taxed twice. Inherited assets are generally valued at their value on the date of death, and gifted assets usually carry the giver’s basis, so the rules depend on how you acquired the asset. Gather records before you sell, because a wrong basis changes the entire result.
What the calculator does not cover
- Home-sale exclusions for a main residence.
- Depreciation recapture on rental or business property.
- Higher rates on collectibles and certain small business stock.
- Alternative minimum tax and phase-outs of deductions or credits.
- Local taxes.
It is an estimate. Confirm the final figure with a tax professional before a large sale.
Common mistakes
- Using the sale price as the gain. Tax applies only to the gain after basis.
- Forgetting state tax. It can add several points to the bill.
- Selling a day too early. Check the holding period.
- Ignoring the effect on other income. A large gain can push other income into a higher bracket or trigger the investment income tax.
- Not planning for estimated payments. A large gain may require quarterly payments to avoid an underpayment penalty.
Next steps
Enter the basis, expected sale price, other income, filing status and state rate for your own situation, then try selling in a different tax year or after the one-year date to see the difference. If a sale is large or involves a business, home or inherited property, request a free call using the form on this page. A licensed advisor will reach out by phone or video to talk through the planning, free and with no obligation.
Related reading and tools
- 2027 tax brackets and standard deduction
- Dividend Calculator
- Roth Conversion Calculator
- Finding a tax advisor near you
- All financial calculators
Frequently asked questions
How is capital gains tax calculated?
Subtract your cost basis from the sale price to find the gain. Long-term gains are taxed at 0%, 15% or 20% based on your taxable income. Short-term gains are added to your ordinary income and taxed at your regular rates.
How much income can I have and pay 0% capital gains tax?
For 2026, taxable income up to $49,450 for single filers and $98,900 for married couples filing jointly. For 2027, the limits rise to $51,050 and $102,100.
Do I pay capital gains tax when I sell my house?
Often not. If you owned and lived in the home for at least two of the five years before the sale, you can exclude up to $250,000 of gain, or $500,000 if married filing jointly. This calculator does not apply that exclusion.
Do states tax capital gains?
Most states tax capital gains as regular income, and a few have no income tax. Enter your state’s rate above, and check current rules with a tax professional.
Related calculators
Dividend Calculator
Estimate dividend income and the effect of reinvesting it.
Open calculator →Roth Conversion Calculator
See the tax now, the value later and the rate where converting breaks even.
Open calculator →Investment Calculator
Project portfolio growth and see what fees cost over time.
Open calculator →Sources and further reading
- IRS Topic 409: Capital gains and losses
- IRS Topic 701: Sale of your home
- IRS: Net investment income tax
See our editorial standards for how we build and review our tools.
Want help planning around a big sale?
Talk it through with a licensed financial advisor, by phone or video call. Free and with no obligation.
Latest money guides and ideas
- States With Inheritance Tax: Rates and Who Pays in 2026Five states with inheritance tax remain: Kentucky, Maryland, Nebraska, New Jersey and Pennsylvania. See each state’s rates, who is exempt and worked examples.
- Treasury Bills: How to Buy T-Bills and How They Are TaxedTreasury bills are short-term U.S. government debt sold at a discount. Learn how T-bills pay interest, two ways to buy them, and how the interest is taxed.
- Is Long-Term Care Insurance Worth It? Cost and CoverageIs long-term care insurance worth it? See what a policy covers, what drives the premium, when to buy, who should skip it and the 2027 tax limits.
- Mega Backdoor Roth: How It Works and 2027 LimitsA mega backdoor Roth moves after-tax 401(k) contributions into a Roth account. See the 2027 limits, what your plan has to allow, worked examples and the steps.
- Saver’s Match 2027: Who Qualifies and How to Claim ItThe Saver’s Match starts with 2027 contributions: a federal deposit of up to $1,000 a year into your retirement account. See the income limits, what counts and how to claim it.
- How to Avoid Capital Gains Tax on Real Estate: 7 WaysSeven legal ways to reduce or avoid capital gains tax on real estate, from the $250,000 and $500,000 home sale exclusion to 1031 exchanges, with worked examples for a home and a rental.
- Medicare Supplement Plans Comparison Chart for 2027Compare all 10 Medicare supplement plans side by side for 2027: what Plans A through N cover, the new deductibles and out-of-pocket limits, and a worked example of what each would leave you to pay.
- FERS Supplement: Who Gets It, How Much, When It StopsThe FERS supplement pays eligible federal retirees an extra monthly amount until age 62. See who qualifies, how it is calculated and how the earnings test can reduce it.
- 403(b) vs 401(k): Key Differences and 2027 LimitsA 403(b) and a 401(k) share the same 2027 contribution limits, but they differ in who offers them, what you can invest in and one extra catch-up for long-serving employees.









