Skip to main content
HSCalculadora

Capital Gains Tax Calculator

Estimate tax owed on an investment sale.

$
$
%

Results update as you type.

Capital gain
—
Tax owed—
Net profit after tax—

This calculator is for illustrative purposes only. Actual rates, fees and terms vary by lender. Consult a qualified financial adviser before making borrowing decisions.

How it works

Capital gains tax is the tax you owe on the profit from selling an asset — stocks, a fund, real estate or other property — for more than you paid. The figures shown here are your gain, the tax on it, and what you keep after tax. It matters because the profit on paper is not all yours: the tax can take a meaningful slice, so knowing the after-tax number is what tells you the real return on an investment. This capital gains tax calculator subtracts your purchase price, or cost basis, from your sale price to find the gain, applies your tax rate to that gain, and subtracts the tax to show your net profit. Taxing only the gain — not the whole sale price — is how capital gains work: you are taxed on the increase in value, not on the return of your original investment. If you sold at a loss, the gain is negative and no tax is due, so the tool shows zero tax in that case. Investors use it to estimate the tax hit before selling, to compare holding versus selling, and to see how the difference between short-term and long-term rates changes the outcome. The rate you enter should reflect your situation: short-term gains on assets held a year or less are taxed as ordinary income, while long-term gains get preferential rates. Because actual liability depends on your income, filing status, holding period and other rules, treat this as an estimate and confirm specifics with the IRS or a tax professional.

Formula

Capital gain = sale price − purchase price · Tax owed = gain × rate ÷ 100 (if gain > 0) · Net profit = gain − tax

The capital gain is simply the sale price minus the purchase price (your cost basis), representing the profit on the asset. Multiplying that gain by your tax rate as a decimal gives the tax owed, but only when the gain is positive — a sale at a loss produces no capital gains tax, so the tool returns zero tax there. Subtracting the tax from the gain leaves your net profit, the amount you actually keep. Only the gain is taxed, because returning your original investment is not income.

Source:IRS — capital gains

We review all our tools from time to time to ensure accuracy.

Worked example

Purchase price (cost basis):10000Sale price:15000Capital gains tax rate:15
Buying at $10,000 and selling at $15,000 is a $5,000 gain; at a 15% rate the tax is $750, leaving $4,250 in net profit.

How to use this calculator

  1. 1

    Enter your values

    Enter purchase price (cost basis), sale price and capital gains tax rate.

  2. 2

    Adjust the options

    Fine-tune any options to match your situation.

  3. 3

    Read your result

    Capital gain updates instantly as you type — no button to press.

Frequently asked questions

What is the difference between short-term and long-term gains?

The holding period determines the rate. Assets held for one year or less produce short-term capital gains, taxed at your ordinary income tax rate, which can be high. Assets held longer than a year produce long-term capital gains, taxed at preferential rates — 0%, 15% or 20% for most taxpayers depending on income. This large gap is why many investors hold assets past the one-year mark before selling. Enter the rate that matches your holding period for an accurate estimate.

What is a cost basis?

Your cost basis is what you paid to acquire an asset, used to figure the taxable gain when you sell. It typically includes the purchase price plus any commissions or fees, and for some assets it can be adjusted for things like reinvested dividends or improvements to a property. The gain is the sale price minus this basis. Keeping accurate records of your basis is important, because overstating it understates your gain and could cause problems, while understating it makes you overpay tax.

Do I owe tax if I sold at a loss?

No capital gains tax is due on a loss, and the calculator shows zero tax when the sale price is below the purchase price. In fact, capital losses can be valuable: they offset capital gains elsewhere in your portfolio, and if losses exceed gains, you can typically deduct a limited amount against ordinary income each year and carry the rest forward. This strategy, called tax-loss harvesting, is a common way to reduce a tax bill, though specific rules apply.

What tax rate should I enter?

Enter the capital gains rate that applies to your situation. For a long-term gain, that is usually 0%, 15% or 20% depending on your taxable income and filing status, with most middle-income taxpayers at 15%. For a short-term gain, use your ordinary income tax bracket. High earners may also owe an additional 3.8% net investment income tax. If you are unsure, 15% is a reasonable default for long-term gains, but confirm your actual rate for a precise figure.

Are there ways to reduce capital gains tax?

Several strategies exist. Holding an asset longer than a year qualifies you for lower long-term rates. Offsetting gains with losses through tax-loss harvesting reduces the taxable amount. Holding investments in tax-advantaged accounts like IRAs or 401(k)s defers or avoids the tax entirely. For a home sale, a portion of the gain may be excluded if it was your primary residence. These rules are detailed and situation-specific, so consult IRS guidance or a tax professional before acting.