Capital Gains Tax Calculator
Quickly compute capital gains tax with accurate formulas. See amortization schedules, growth projections, and side-by-side comparisons.
Capital Gains Tax Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: Capital Gain = Sale Price - Purchase Price | Long-term (>12mo): 0/15/20% | Short-term (โค12mo): Ordinary income rate
Worked example โ $750 tax, $4,250 net
Formula
Capital Gain = Sale Price - Purchase Price | Long-term (>12mo): 0/15/20% | Short-term (โค12mo): Ordinary income rate
Long-term capital gains (held >12 months) are taxed at 0%, 15%, or 20% depending on income. Short-term gains are taxed as ordinary income.
Worked Examples
Example 1: Stock sale
Problem:Buy $10K, sell $15K after 18 months, 22% bracket
Solution:Gain=$5K, long-term, 15% rate โ Tax=$750, Net=$4,250
Result:$750 tax, $4,250 net
Frequently Asked Questions
What qualifies as long-term?
Assets held more than 12 months qualify for lower long-term capital gains rates (0%, 15%, or 20%). Under 12 months = short-term, taxed as ordinary income.
What are the 2024 long-term capital gains tax rates?
For 2024, long-term capital gains rates are 0% for single filers with taxable income up to $47,025 and married filing jointly up to $94,050; 15% for single filers earning $47,026 to $518,900 and married up to $583,750; and 20% for income above those thresholds. High-income earners also pay an additional 3.8% Net Investment Income Tax (NIIT) on gains if their modified adjusted gross income exceeds $200,000 (single) or $250,000 (married), effectively making the top rate 23.8%.
Can I use capital losses to offset capital gains?
Yes. Capital losses directly offset capital gains dollar for dollar. Short-term losses first offset short-term gains, and long-term losses first offset long-term gains, before crossing over. If your losses exceed your gains, you can deduct up to $3,000 of net capital losses against ordinary income per year. Any losses beyond $3,000 are carried forward to future tax years indefinitely. This tax-loss harvesting strategy is commonly used by investors near year-end to sell losing positions to offset gains realized earlier in the year.
How are capital gains taxed differently for real estate?
For your primary residence, the IRS allows a capital gains exclusion of up to $250,000 (single) or $500,000 (married filing jointly) if you have owned and lived in the home for at least 2 of the 5 years before the sale. For investment real estate, long-term gains are taxed at 0%, 15%, or 20%, but depreciation taken during ownership is recaptured at a 25% rate. Real estate investors may also defer capital gains through a 1031 exchange by reinvesting proceeds into another investment property within 180 days of the sale.
What is cost basis and which adjustments change it?
Cost basis is what the asset cost you for tax purposes, and the gain is sale proceeds minus basis, so getting it right matters as much as the rate. It starts with the purchase price plus commissions and acquisition costs. It rises with reinvested dividends and capital gain distributions, and with capital improvements on property; it falls with returns of capital and with depreciation claimed on rental property. Stock splits divide basis across the new share count without changing the total.
What is the wash sale rule and how does it affect loss harvesting?
If you sell a security at a loss and buy the same or a substantially identical security within 30 days before or after that sale, the loss is disallowed for the current year. It is not lost permanently: the disallowed amount is added to the basis of the replacement shares and the holding period carries over. The window is 61 days in total and it counts purchases in your IRA and, in practice, your spouse's accounts too - note that when the replacement shares are bought inside an IRA the disallowed loss is forfeited outright rather than added to any basis - which is what catches people running automatic dividend reinvestment.
Which share-identification method should I use when selling part of a position?
The default for stock is first in, first out, which sells your oldest and often lowest-basis shares and typically maximises the reported gain. Specific identification lets you nominate particular lots - useful for selling high-basis shares to minimise gain, or long-held lots to secure long-term treatment - but you must identify them with the broker at or before the sale, not afterwards. Mutual funds also permit an average-cost method. The choice changes the tax, never the cash you receive.
How exactly is the holding period measured?
The clock starts the day after you acquire the asset and runs through the day you sell it. Long-term treatment requires more than one year, so an asset bought on 10 March and sold on 10 March the following year is still short-term by a day; selling on 11 March qualifies. Trade dates govern, not settlement dates. Property received as a gift generally carries over the donor's holding period, and inherited property is treated as long-term regardless of how briefly you held it.
What is the step-up in basis at death?
When an asset passes to heirs, its basis is generally reset to fair market value on the date of death, so the appreciation that accrued during the owner's lifetime escapes capital gains tax entirely if the heir then sells. Inherited assets also receive long-term treatment automatically. This is why holding a highly appreciated position rather than realising the gain late in life can be tax-efficient, and it is the mirror image of a gift during life, where the recipient inherits the original basis.
Are unrealised gains taxed while I still hold the asset?
No. Under the realisation principle, an increase in value creates no tax liability until a taxable disposition occurs - typically a sale or exchange. That deferral is itself valuable, because money that would have gone to tax stays invested and compounds. It is the main reason buy-and-hold investing in a taxable account can outperform frequent trading on an after-tax basis even at identical pre-tax returns. Note that mutual funds can distribute realised gains to you even in a year you sold nothing.
References
Reviewed for accuracy by Sahil, Senior Finance & Tax Editor ยท Editorial policy
Related Calculators
๐งฎCrypto Capital Gains Tax Calculator
Calculate short-term and long-term capital gains tax on cryptocurrency trades and estimate your crypto tax liability.
๐งฎTax-Loss Harvesting Calculator
Calculate potential tax savings from harvesting investment losses against capital gains.
๐งฎSalary Tax Take-Home Pay Calculator
Calculate salary tax take home with inputs, formulas, and instant results.
๐งฎRental Income Tax Calculator โ Deductions Included
Calculate tax on rental income after deducting mortgage interest, depreciation, and expenses.
๐งฎTax Withholding Calculator
Calculate the right federal tax withholding from pay frequency, filing status, and allowances.
๐งฎHourly to Salary Converter with Overtime
Calculate hourly to salary converter with inputs, formulas, and instant results.
๐งฎTax Bracket Estimator with Deductions
Estimate your federal tax liability after standard or itemized deductions, with effective tax rate and take-home pay.
๐งฎProperty Tax Calculator
Calculate property tax with inputs, formulas, and instant results.