Finance calculators

Capital Gains Calculator

Updated Aug 3, 2026 By Jehan Wadia
Rate Formulas

* Required field. All amounts in U.S. dollars; federal figures use 2025 IRS brackets.

1. Asset Type

Asset type changes which federal rules apply (28% collectibles cap, home-sale exclusion, depreciation recapture).

2. Sale & Cost Basis Information

What you originally paid for the asset.
Upgrades that add value (new roof, addition). Repairs do not count.
Total depreciation claimed over the years you owned it.
Total gross proceeds before any costs.
Commissions, closing costs, legal and agent fees.
Paid off at closing — used for your net cash-in-hand.
Net Adjusted Basis (Purchase + Improvements − Depreciation)
$285,000.00
Gross Capital Gain (Sale − Basis − Selling Expenses)
$205,000.00

3. Ownership & Filing Details

How long did you own it? *
This is the single biggest driver of your tax rate.
Your ordinary income (wages, business, interest) before this sale. Deductions in the Advanced panel are subtracted from it.
Sets the estimated state rate below — you can edit it.
Auto-filled from your state and holding period. Editing it overrides the lookup.
Some cities (e.g. New York City) add their own tax.

These fields improve the accuracy of your federal tax bracket calculation.


Headline Summary
Total Estimated Capital Gains Tax
$0.00
After-Tax Equity (Net Cash-in-Hand)
$0.00
Sale − selling costs − loan payoff − tax
Gross Capital Gain
$0.00
Before tax
Effective Total Tax Rate
0.00%
Total tax ÷ gross gain
Full Tax Breakdown
Every component of your estimated capital gains tax, with the taxable amount, rate applied and tax due.
Tax Component Taxable Amount Rate Applied Tax Due
Short-Term vs. Long-Term Comparison
Chart data is also listed in the table below, which is the accessible equivalent. Each bar is labelled with its dollar amount.
Side-by-side comparison of tax owed under short-term and long-term holding.
Line Item Short-Term (< 1 year) Long-Term (1 year+)
Cost Basis & Equity Waterfall
Step-by-Step Solution

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. It works for stocks, crypto, real estate, collectibles, and business assets. If you only need the raw profit before tax, the simpler Capital Gains Calculator and the Stock Profit Calculator handle that first step.

Time matters a lot. If you held the asset less than one year, your gain is short-term and taxed at your normal income rate. If you held it one year or more, it is long-term and taxed at 0%, 15%, or 20%. The tool compares both side by side, so you can see what waiting could save you. To see which ordinary bracket a short-term gain lands in, pair this with the Tax Bracket Calculator.

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 exclusion of up to $250,000, or $500,000 if you file jointly, and the Home Sale Calculator can walk through the closing side of that deal. 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. For digital assets, the Crypto Tax Calculator and Crypto Profit Calculator go deeper on coin-by-coin lots.

Section 121 Home Sale Exclusion: This box shows only for a primary residence. Check it if you 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).

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%. If you are not sure of the total, rebuild it with the Depreciation Calculator.

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. The Closing Cost Calculator helps you estimate these if the sale has not closed yet.

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. Check your current payoff figure with the Mortgage Payoff Calculator or the Home Equity Calculator.

How long did you own it: Choose less than one year (short-term) or one year or more (long-term). 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. The Taxable Income Calculator and AGI Calculator can help you pin down that figure.

State / Location: Choose your state. The calculator fills in a state rate for you. For a fuller picture of your state bill, see the State Tax Calculator or, for high-rate states, the California Tax Calculator.

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. The NYC Paycheck Calculator shows how those local rates work.

401(k) / 403(b) Contributions: In the Advanced panel, enter pre-tax retirement contributions. These lower the income used for your bracket. See the 401k Calculator or 403b Calculator to plan those amounts.

IRA Contributions: Enter deductible traditional IRA contributions only. The IRA Calculator covers contribution limits and growth.

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 under 1 year): taxed like your paycheck, at ordinary rates from 10% up to 37%. The Income Tax Calculator shows how those rates stack.
  • Long-term (held 1 year or more): taxed at lower rates of 0%, 15%, or 20%, based on your income and filing status.

Waiting past the one-year mark can save you thousands of dollars on the same profit. To see what the tax actually costs you as a share of your total income, try the Effective Tax Rate Calculator.

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%. The Rental Property Calculator and Cap Rate Calculator help you weigh selling versus holding.
  • Net Investment Income Tax (NIIT): a 3.8% surtax once your income passes $200,000 (single) or $250,000 (married filing jointly). Check the threshold with the MAGI Calculator.
  • Collectibles: art, coins, and similar items have a higher long-term cap of 28%. For metals, the Gold Price Calculator and Silver Calculator help value what you sold.
  • 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 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. This is the Section 121 exclusion. Depreciation you claimed on the home cannot be excluded. If you are deciding whether to sell or stay put, the Rent vs Buy Calculator and Property Tax Calculator add useful context.

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 — model it with the Retirement Calculator.
  • 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 using the Roth IRA Calculator or HSA Calculator.

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). Anything left over carries into future years. Once you know your tax, the Investment Calculator can project what the after-tax proceeds might grow into.

These results are estimates for planning only. Tax law is complex, so check with a CPA or tax advisor before you file. For your overall bill, including wages and other income, see the Tax Calculator or the Tax Refund Calculator.


Formulas used

Net Adjusted Basis
\text{Basis} = \text{Purchase Price} + \text{Improvements} - \text{Depreciation}
Gross Capital Gain
\text{Gain} = \text{Sale Price} - \text{Basis} - \text{Selling Expenses}
Income used for bracketing
\text{Adj. Income} = \max\!\left(0,\; \text{Income} - \text{401(k)} - \text{IRA} - \max(\text{Standard},\ \text{Itemized})\right)
Taxable gain after recapture and Section 121 exclusion
\begin{aligned}\text{Recapture} &= \min(\text{Depreciation},\ \text{Gain}) \\ \text{Excluded} &= \min(\text{Excl. Limit},\ \text{Gain} - \text{Recapture}) \\ \text{Taxable Gain} &= \text{Gain} - \text{Recapture} - \text{Excluded}\end{aligned}
Bracket-stacked tax (federal capital gains and depreciation recapture, capped rate)
\text{Tax} = \sum_{i} \text{Slice}_i \times \min(r_i,\ r_{\text{cap}}), \quad \text{Slice}_i = \min\!\left(\text{Remaining},\ \text{Limit}_i - \text{Position}\right)
Net Investment Income Tax (3.8% surtax)
\text{NIIT} = \min\!\left(\text{Recapture} + \text{Taxable Gain},\; \max(0,\ \text{MAGI} - \text{Threshold})\right) \times 3.8\%
State and local capital gains tax
\text{State} = (\text{Recapture} + \text{Taxable Gain}) \times \frac{r_{\text{state}}}{100}, \qquad \text{Local} = (\text{Recapture} + \text{Taxable Gain}) \times \frac{r_{\text{local}}}{100}
Total tax, after-tax equity and effective rate
\begin{aligned}\text{Total Tax} &= \text{Federal} + \text{Recapture Tax} + \text{NIIT} + \text{State} + \text{Local} \\ \text{Net Cash} &= \text{Sale Price} - \text{Selling Expenses} - \text{Loan Balance} - \text{Total Tax} \\ \text{Effective Rate} &= \frac{\text{Total Tax}}{\text{Gain}} \times 100\%\end{aligned}

Frequently asked questions

When do I actually have to pay the capital gains tax?

Tax is due for the year the sale closes. But the IRS wants money as you earn it. If you owe a large amount, you may need to send an estimated tax payment by the next quarterly due date (April 15, June 15, September 15, or January 15). Paying late can trigger an underpayment penalty, even if you pay in full by the filing deadline.

Does this calculator save my information?

No. Everything runs in your browser. Nothing you type is stored or sent anywhere. Close the tab and the numbers are gone, so write down or screenshot your results if you want to keep them.

Why does my tax change when I edit the Advanced panel?

Your 401(k), IRA, and itemized deduction entries lower the income used to set your bracket. A lower bracket can push part of a long-term gain into the 0% or 15% band instead of 20%. Dependents are the one field that does not change the result — they are shown for context only.

What number should I put in Estimated Annual Taxable Income?

Enter your other income for the year before this sale and before deductions. That means wages, self-employment profit, interest, and dividends. Do not include the gain from this sale — the calculator adds it for you. Do not subtract your standard deduction either; the tool does that step.

Why is the loan balance not lowering my tax?

A mortgage is not part of your cost basis. The IRS taxes your profit, not your equity. Your loan payoff only affects how much cash you walk away with, so it shows up in the After-Tax Equity figure and the waterfall, never in the tax math.

Can the calculator handle a sale where I owned the asset with someone else?

Yes, but enter only your share. If you owned half a property, enter half the purchase price, half the improvements, half the sale price, and half the selling costs. Then use your own filing status and income.

What does the Effective Total Tax Rate mean?

It is your total tax divided by your gross gain. It blends federal, state, local, NIIT, and recapture into one number. It is almost always lower than your top marginal rate, because the first slices of your gain get taxed at lower rates.

Why is my depreciation recapture rate under 25%?

25% is the cap, not a flat rate. Recapture is taxed at your ordinary income rates, but never above 25%. If you sit in the 22% bracket, part or all of the recapture is taxed at 22%, so the blended rate lands below 25%.

Do I still owe recapture if I never claimed depreciation on my rental?

Usually yes. The IRS taxes depreciation you were allowed to take, not just what you claimed. Talk to a CPA — you may be able to fix past returns. If you enter $0 here, the calculator will show a lower tax than you may actually owe.

Why does the short-term column show no depreciation recapture?

Recapture is a long-term rule. Under short-term treatment, the whole gain — including the depreciation part — is already taxed at your ordinary income rates, so it sits inside the federal row instead of getting its own line.

My state charges no income tax. Why is there still a state rate box?

The box is always shown so you can override it. If you pick Florida, Texas, or another no-tax state, the rate fills in as 0.00% and your state tax is $0.00. You can type a rate if you owe tax to a different state, such as where a property sits.

Which state do I pick if I live in one state and sold property in another?

Real estate is normally taxed by the state where the property is located. Pick that state. You may also owe tax in your home state, though most states give a credit for tax paid elsewhere. Check with a tax pro for two-state sales.

Can I use this for a gift or inherited asset?

Yes, if you know your basis. For inherited assets, the basis usually steps up to the market value on the date of death — enter that as the purchase price. Inherited assets also count as long-term no matter how long you held them. For gifts, you normally keep the giver's original basis.

Does a 1031 exchange work in this calculator?

No. A 1031 exchange delays the tax when you swap one investment property for another, and it has strict deadlines. This tool assumes a plain cash sale. Use the result to see what tax you would avoid by doing an exchange, then talk to a qualified intermediary.

What if I sold more than one asset this year?

Run each sale on its own. Gains and losses from different sales offset each other before tax is figured, so add the results by hand or run the combined net gain as a single entry. The calculator handles one sale at a time.

Why is my federal tax $0 but I still owe state tax?

The federal 0% long-term bracket only applies to federal tax. Most states do not copy it. States like California tax gains as regular income from the first dollar, so you can owe state tax with zero federal tax due.

Does the calculator include the wash sale rule?

No. The wash sale rule blocks a loss if you buy the same stock within 30 days before or after the sale. This tool does not track that. If a wash sale applies, the loss is delayed and added to the basis of your new shares instead.

Are the 2025 brackets still right for a sale I make now?

The tool uses 2025 IRS brackets and thresholds. Bracket cutoffs shift a little each year with inflation, so a 2026 sale will differ slightly. The rate structure — 0%, 15%, 20%, plus 3.8% NIIT and the 25% recapture cap — has not changed, so the estimate stays close.

What counts as a capital improvement versus a repair?

An improvement adds value or extends the life of the asset: a new roof, an added room, a full kitchen remodel, new HVAC. A repair just keeps things working: patching a leak, painting, fixing an appliance. Only improvements raise your basis and cut your tax.

Can my net cash be negative?

Yes. If your loan balance plus selling costs plus tax are more than your sale price, you bring money to closing. This happens most with a rental that has heavy depreciation and a large mortgage — you can owe tax on paper gain while getting little or no cash.

Why did the calculator use the standard deduction instead of my itemized amount?

The IRS lets you take the larger of the two, so the tool picks whichever is bigger. If your itemized total is under the standard deduction for your filing status, the standard amount is used and a note explains it in the results.

Does the Section 121 exclusion cover my rental depreciation?

No. The exclusion wipes out up to $250,000 or $500,000 of regular gain, but depreciation you claimed while renting the home is still taxed at up to 25%. The calculator pulls recapture out first, then applies the exclusion to what is left.

Is crypto really taxed the same as stocks?

Yes. The IRS treats crypto as property, so the same 0%, 15%, and 20% long-term rates apply. Note that trading one coin for another counts as a sale, and so does spending crypto on goods. Each of those is a taxable event with its own holding period.