Introduction
When you sell something for more than you paid, the profit is called a capital gain. The IRS taxes that gain. This capital gains tax calculator shows you how much tax you may owe and how much cash you keep.
Enter what you paid, what you sold it for, your selling costs, and your income. The calculator then figures your federal tax, state tax, the 3.8% Net Investment Income Tax, and depreciation recapture if you sold a rental.2 It works for stocks, crypto, real estate, collectibles, and business assets.
Time matters a lot. If you held the asset one year or less, your gain is short-term and taxed at your normal income rate. If you held it more than one year, it is long-term and taxed at 0%, 15%, or 20%.1 The tool compares both side by side, so you can see what waiting could save you.
You also get a full tax breakdown, a step-by-step math solution, and a waterfall that tracks your sale price down to net cash in hand. Sold your main home? The calculator applies the Section 121 home sale exclusion. That exclusion is up to $250,000, or $500,000 if you file jointly.3 All numbers use 2025 IRS brackets and are estimates, not tax advice.
How to use our Capital Gains Tax Calculator
Enter what you bought, what you sold it for, how long you owned it, and where you live. The calculator shows your estimated capital gains tax, your federal, state, local and recapture tax breakdown, your net cash after the sale, and a short-term vs. long-term comparison.
Asset Type: Pick what you sold, such as stocks, crypto, a rental property, your home, collectibles, or business assets. This choice sets the tax rules used.
Section 121 Home Sale Exclusion: This box shows only for a primary residence. Check it if you owned and lived in the home at least 2 of the last 5 years. It removes up to $250,000 of gain ($500,000 if married filing jointly).3
Original Purchase Price: Type what you first paid for the asset.
Capital Improvements: Add money spent on upgrades that raise value, like a new roof or an addition. Do not count repairs.
Depreciation Taken: Enter the total depreciation you wrote off over the years. This matters most for rental property, since it gets taxed back at up to 25%.1
Sale Price: Type the full amount you sold the asset for, before any costs.
Selling Expenses: Add agent commissions, closing costs, and legal fees tied to the sale.
Outstanding Loan / Mortgage Balance: Enter the loan amount paid off at closing. This is used to find your net cash in hand, not your tax.
How long did you own it: Choose one year or less (short-term) or more than one year (long-term).1 This has the biggest effect on your rate.
Filing Status: Pick single, married filing jointly, married filing separately, head of household, or qualifying widow(er). This sets your brackets and deduction.
Estimated Annual Taxable Income: Enter your other income for the year, like wages or business income, before this sale.
State / Location: Choose your state. The calculator fills in a state rate for you.
State Capital Gains Tax Rate: Keep the filled-in rate or type your own if you know it.
Local / City Tax Rate: Add a city rate if your city taxes income, like New York City. Leave it at 0 if not.
401(k) / 403(b) Contributions: In the Advanced panel, enter pre-tax retirement contributions. These lower the income used for your bracket.
IRA Contributions: Enter deductible traditional IRA contributions only.
Itemized Deductions: Enter your itemized total. If it is smaller than the standard deduction, the standard one is used.
Number of Dependents: Enter how many dependents you claim. This does not change capital gains rates and is shown for context.
Click Calculate to see your results, or Reset to start over.
What Is Capital Gains Tax?
A capital gain is the profit you make when you sell something for more than you paid for it. This can be stocks, crypto, a rental house, land, art, or a business. The tax you pay on that profit is called capital gains tax. If you sell for less than you paid, you have a capital loss, and you owe no tax on that sale.
How Your Gain Is Figured
Your gain is not just the sale price minus the purchase price. The IRS uses your adjusted cost basis:
- Start with what you paid for the asset.
- Add capital improvements, like a new roof or an addition. Normal repairs do not count.
- Subtract any depreciation you wrote off on a rental or business property.
Then take your sale price, subtract that basis, and subtract selling costs like agent fees and closing costs. What is left is your gain. If you bought shares over time at different prices, the Stock Average Calculator is a quick way to find your blended cost.
Short-Term vs. Long-Term
How long you owned the asset matters more than anything else:
- Short-term (held one year or less): taxed like your paycheck, at ordinary rates from 10% up to 37%.4 The Income Tax Calculator shows how those rates stack.
- Long-term (held more than one year): taxed at lower rates of 0%, 15%, or 20%, based on your income and filing status.1
Waiting past the one-year mark can save you thousands of dollars on the same profit.
Extra Taxes That Can Apply
- Depreciation recapture: if you claimed depreciation on a rental, that part of your gain is taxed at up to 25%.1
- Net Investment Income Tax (NIIT): a 3.8% surtax once your income passes $200,000 (single) or $250,000 (married filing jointly).2 Check the threshold with the MAGI Calculator.
- Collectibles: art, coins, and similar items have a higher long-term cap of 28%.1
- State and local tax: some states, like Florida and Texas, charge nothing. Others, like California, tax gains as regular income. A few cities add their own tax on top.
The Home Sale Break
If you sell your main home and owned and lived in it at least 2 of the last 5 years, you can exclude up to $250,000 of gain if single, or $500,000 if married filing jointly.3 This is the Section 121 exclusion. Depreciation you claimed on the home cannot be excluded.
Ways to Lower the Tax
- Hold assets at least one year before selling.
- Sell in a year when your income is lower, such as an early retirement year.
- Use losses on other sales to cancel out gains. This is called tax-loss harvesting.
- Keep receipts for improvements, since they raise your basis and cut your gain.
- For rentals, ask a tax pro about a 1031 exchange, which can delay the tax.
- Shift future growth into tax-sheltered accounts.
Losses that are bigger than your gains can cut up to $3,000 of your regular income each year ($1,500 if married filing separately).1 Anything left over carries into future years.
These results are estimates for planning only. Tax law is complex, so check with a CPA or tax advisor before you file.