Introduction
When you sell an asset like stocks, real estate, or other investments for more than you paid, the profit you make is called a capital gain. The government taxes this profit, and the amount you owe is known as capital gains tax. How much tax you pay depends on a few key things: how long you held the asset, your income level, and your tax filing status. Assets held for more than one year are taxed at lower long-term rates, while assets held for one year or less are taxed at higher short-term rates, which match your regular income tax bracket.1
This Capital Gains Tax Calculator helps you quickly estimate how much tax you may owe on the sale of an asset. Enter your purchase price, sale price, holding period, and income details, and the calculator gives you your capital gains tax. Knowing your potential tax bill ahead of time can help you make smarter decisions about when to sell and how to plan your finances.
How to Use Our Capital Gains Tax Calculator
Enter details about your investment sale below to find out how much you owe in capital gains tax.
Purchase Price: Type in the total amount you paid when you first bought the asset, including sales tax and other expenses connected with the purchase. This is your starting cost basis.7
Sale Price: Enter the total amount you received when you sold the asset. This is the final selling price before any taxes.
Holding Period: Choose whether you held the asset for more than one year (long-term) or one year or less (short-term). Long-term gains are usually taxed at a lower rate than short-term gains.
Filing Status: Select your tax filing status, such as single, married filing jointly, married filing separately, or head of household. Your filing status affects which tax bracket you fall into.
Annual Income: Enter your total taxable income for the year, not counting the capital gain. This helps the calculator figure out the correct tax rate for your gain.
State: Select the state where you live. Some states charge their own capital gains tax on top of the federal tax, while others do not. The calculator applies each state's top income tax rate for 2026 to the whole gain, whichever tax year you choose (Washington uses each year's own deduction and rates), so in a state with graduated rates it can overstate the state tax on a smaller gain. It applies a lower long-term rate or a capital gains deduction or exclusion only for Hawaii, Massachusetts, Missouri, Montana, North Dakota, South Carolina and Washington. It does not apply the capital gains deductions or exclusions other states have, extra taxes some states add on high incomes, such as the Massachusetts surtax, Maine's surcharge and Maryland's tax on capital gains, or any city or county income tax.
What Is Capital Gains Tax?
Capital gains tax is a tax you pay on the profit you make when you sell an asset for more than you paid for it. Assets can include stocks, bonds, real estate, or other investments. The "gain" is the amount you receive from the sale, after selling expenses, minus your adjusted basis. Your adjusted basis starts as your purchase price (your cost basis), goes up with improvements and goes down with depreciation.10 If you sell something for less than your adjusted basis, that's called a capital loss, and you generally don't owe tax on it. In fact, you can use losses to offset other gains. A loss on property you held for personal use, such as your home or car, is not deductible.1
Short-Term vs. Long-Term Capital Gains
How long you hold an asset before selling it makes a big difference in how much tax you owe. If you own an asset for one year or less before selling, your profit is a short-term capital gain. Short-term gains are taxed at the same rates as your regular income.1 For 2026 the top federal rate is 37%.2 If you hold the asset for more than one year, your profit is a long-term capital gain. Long-term gains get special, lower tax rates of 0%, 15%, or 20%, depending on your total taxable income and filing status. Some long-term gains have higher maximum rates: 28% on collectibles and on the taxable part of a gain on qualified small business stock, and 25% on the part of a gain on real property that comes from depreciation.1 The calculator does not apply the 28% rate, so for collectibles it can show too little tax. This is why holding an investment for more than one year before selling can save a significant amount in taxes: the IRS counts a gain as long-term only when you hold the asset for more than one year.1 Inherited property counts as long-term however long you held it, and when the basis of a gift is figured from the giver's basis, the time the giver held it counts toward yours.10
How Federal Capital Gains Tax Rates Work
Long-term capital gains tax rates are based on your taxable income. For the 2025 tax year, a single filer pays 0% on long-term gains if their taxable income (including the gain) is $48,350 or less.1 The 15% rate applies to income between $48,350 and $533,400, and the 20% rate kicks in above $533,400.1 For 2026 those limits are $49,450 and $545,500.3 For 2027 they are $51,050 and $563,200.9 These thresholds change based on your filing status. Married couples filing jointly get wider brackets, while married individuals filing separately get narrower ones. The brackets also adjust slightly each year for inflation.
Net Investment Income Tax (NIIT)
On top of regular capital gains tax, high-income earners may owe an additional 3.8% Net Investment Income Tax.4 This tax applies when your modified adjusted gross income exceeds $200,000 for single or head of household filers, $250,000 for married couples filing jointly or a qualifying surviving spouse, or $125,000 for married people filing separately.4 The NIIT is charged on the lesser of your net investment income or the amount by which your income exceeds the threshold.4 It applies to both short-term and long-term gains. The calculator estimates your modified adjusted gross income as your taxable income plus the standard deduction plus the gain. If you itemize or have other deductions, your real figure is higher, and the tax shown may be too low.
State Capital Gains Taxes
Most states that have an income tax treat capital gains as part of your other income, and a few give long-term gains a lower rate or a deduction. State rates vary widely, from 0% in states like Florida, Texas, Nevada, and Wyoming (which have no state income tax) to as high as 13.3% in California. A few states have unique rules. For example, Washington taxes long-term gains above a standard deduction, which is $290,000 for 2026.13 Gains on real estate are exempt.5 Washington taxes the first $1,000,000 of taxable Washington gains at 7% and the part above that at 9.9%, beginning with tax year 2025.14 Massachusetts taxes short-term gains at 8.5% and long-term gains at 5%.6 Your state of residence can have a major impact on your total tax bill, so it's important to factor in state taxes when planning a sale.
Adjustments That Reduce Your Taxable Gain
Several adjustments can lower the amount of capital gains you actually owe tax on:
- Improvements: Money you spent on capital improvements (like home renovations) gets added to your cost basis, which reduces your gain.7
- Selling costs: Broker commissions, closing costs you pay as the seller, and other costs directly tied to the sale are subtracted from the sale price.12 If you sell your main home and meet the IRS conditions, you may be able to exclude up to $250,000 of the gain ($500,000 for a married couple filing jointly).12 The calculator does not apply this exclusion.
- Capital losses: Losses from other investment sales in the same year can offset your gains dollar-for-dollar. If your losses exceed your gains, you can deduct up to $3,000 ($1,500 if married filing separately) of the excess against ordinary income and carry the rest forward to future years.1
Depreciation Recapture
If you claimed depreciation deductions on an asset (most commonly rental property), you may owe depreciation recapture tax when you sell. On real property, the portion of your gain that equals the depreciation you previously claimed is taxed at a maximum federal rate of 25%.1 On other depreciable property, such as equipment, gain up to the depreciation allowed is taxed as ordinary income.10 The calculator treats the depreciation you enter as depreciation on real property. It adds that depreciation back to your gain, because depreciation lowers your basis, and taxes that portion at your ordinary income rates, capped at 25% for property held more than one year. This recapture amount is calculated before the remaining gain is taxed at the normal long-term rates.
Tips for Reducing Capital Gains Tax
- Hold assets longer than one year to qualify for lower long-term rates.
- Harvest losses by selling underperforming investments to offset gains. If you, your spouse or your IRA buys substantially identical stock or securities within 30 days before or after the sale, the loss is not deductible then. It is usually added to the cost of the new shares, which postpones it, but not when your IRA bought them.11
- Use tax-advantaged accounts like IRAs or 401(k)s where gains grow tax-deferred or tax-free.
- Time your sales in years when your income is lower to stay in a lower tax bracket.
- Keep records of all improvements and selling costs to maximize your cost basis adjustments.
- Reinvest strategically using approaches like dollar-cost averaging to build positions over time.