Capital Gains Calculator

Calculate capital gains taxes on your investments and understand the difference between short-term and long-term capital gains taxes.

$
$
$
$
$

What Is a Capital Gains Calculator?

A capital gains calculator estimates the federal tax you will owe when you sell an asset for more than you paid for it. It accounts for the purchase price, improvements, selling costs, holding period, income level, filing status, and primary residence exemption to determine both the taxable gain and the expected tax liability.

Capital gains tax applies to a wide range of assets including stocks, bonds, real estate, collectibles, and business interests. The tax rate depends primarily on how long you held the asset and your total income. Understanding your potential tax obligation before selling helps you make informed decisions about timing, pricing, and whether tax-saving strategies might be worthwhile.

How Capital Gains Tax Works

The calculation begins by determining the total gain on the sale. Gross proceeds equal the sale price minus selling costs. The adjusted basis equals the purchase price plus any capital improvements. The total gain is the difference between gross proceeds and adjusted basis.

Total Gain = (Sale Price - Selling Costs) - (Purchase Price + Improvements)

The holding period determines whether the gain is short-term or long-term. Assets held for more than one year qualify for long-term rates. Short-term gains are taxed at ordinary income rates.

Long-term capital gains tax rates for 2024 are 0 percent for lower income brackets, 15 percent for middle income, and 20 percent for high earners. The specific thresholds vary by filing status.

High-income taxpayers may also owe the 3.8 percent Net Investment Income Tax on their gains. The primary residence exclusion can eliminate up to $250,000 or $500,000 of gain on a qualified home sale.

How to Use This Calculator

  1. Enter the purchase price. This is what you originally paid for the asset.

  2. Enter the sale price. This is the amount you received or expect to receive from the sale.

  3. Enter improvements and selling costs. Improvements increase your basis and reduce the gain. Selling costs are subtracted from the sale price.

  4. Enter the holding period. This determines whether the gain is taxed at short-term or long-term rates.

  5. Enter your income and filing status. These determine which tax bracket and rate applies to your gain.

  6. Check primary residence if applicable. If you are selling a home where you have lived for at least 2 of the last 5 years, enable this option for the exclusion.

  7. Review the results. The calculator shows the total gain, applicable exemptions, tax breakdown, and net proceeds after tax.

Worked Examples

Example 1: Long-Term Stock Sale

Purchased stock for $50,000, sold for $80,000. No improvements or selling costs. Held for 3 years. Income $75,000, filing single. Total gain is $30,000. Long-term rate at this income is 15 percent. Capital gains tax is $4,500. Net proceeds are $75,500.

Example 2: Primary Home Sale Under Exclusion

Purchased home for $300,000, improvements of $25,000, sold for $450,000 with $27,000 selling costs. Lived there 5 years, filing married. Gross proceeds $423,000 minus adjusted basis $325,000 equals $98,000 gain. The $500,000 married exclusion covers the entire gain. Tax owed is $0.

Example 3: Investment Property Sale

Purchased rental for $200,000, sold for $350,000. Improvements $15,000, selling costs $21,000. Held 4 years. Income $120,000, single. Total gain is $114,000. Long-term rate 15 percent yields $17,100 tax. No NIIT applies as income is under $200,000. Net proceeds are $311,900.

Example 4: Short-Term Flip

Purchased property for $180,000, renovated for $40,000, sold for $280,000 with $16,800 selling costs. Held 8 months. Income $85,000, single. Total gain is $43,200. Short-term rate at this income is 22 percent. Tax is $9,504. Net proceeds are $253,696.

Common Use Cases

Homeowners selling a property use the calculator to estimate their tax bill and determine whether the primary residence exclusion covers their gain. Investors evaluate the tax impact of selling stocks, mutual funds, or real estate holdings. The results help with timing decisions, such as waiting past the one-year mark to qualify for long-term rates.

Estate planners use capital gains projections to compare selling assets before versus after death, since inherited assets receive a stepped-up basis that eliminates gains accrued during the original owner's lifetime.

Tips and Common Mistakes

Keep detailed records of improvements. Every dollar of documented improvement reduces your taxable gain. Save receipts, invoices, and permits for any work that adds value to the property.

Time your sales strategically. If you are close to the one-year mark, waiting a few extra weeks to qualify for long-term rates can cut your tax rate significantly. Similarly, selling in a lower-income year reduces the applicable rate.

Do not forget about selling costs. Real estate commissions, transfer taxes, and attorney fees all reduce your taxable gain. Include every legitimate selling expense.

Understand the primary residence rules carefully. You must have owned and used the home as your primary residence for at least 2 of the 5 years before the sale. Partial exclusions may be available if you moved due to work, health, or unforeseen circumstances before meeting the full requirement.

Consider tax-loss harvesting. If you have losses in other investments, selling them in the same year as a gain can offset the gain and reduce your tax bill. Net losses up to $3,000 can offset ordinary income as well.

This calculator provides estimates only. Capital gains tax law is complex and varies by state. Consult a tax professional for precise calculations, especially for large transactions or unusual situations.

Frequently Asked Questions

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

Short-term capital gains apply to assets held one year or less and are taxed at your ordinary income tax rate, which ranges from 10 to 37 percent. Long-term capital gains apply to assets held longer than one year and are taxed at preferential rates of 0, 15, or 20 percent depending on your income level. The holding period is measured from the day after purchase to the day of sale.

What is the primary residence exclusion?

If you sell a home that has been your primary residence for at least 2 of the last 5 years, you can exclude up to $250,000 of capital gains from taxes if filing single, or $500,000 if married filing jointly. This exclusion can be used once every two years. It is one of the most valuable tax benefits available to homeowners and can eliminate capital gains tax entirely for many home sales.

What is adjusted basis and how does it affect my taxes?

Adjusted basis is your original purchase price plus the cost of capital improvements minus any depreciation claimed. Improvements that add value or extend the life of the property, such as a new roof, kitchen renovation, or room addition, increase your basis and reduce your taxable gain. Routine maintenance and repairs do not qualify as improvements that increase basis.

What is the Net Investment Income Tax?

The NIIT is an additional 3.8 percent tax on investment income for high earners. It applies when your modified adjusted gross income exceeds $200,000 for single filers or $250,000 for married filing jointly. The tax applies to the lesser of your net investment income or the amount by which your income exceeds the threshold. Primary residence sales exempt from capital gains are also exempt from NIIT.

How are selling costs handled in the calculation?

Selling costs such as real estate agent commissions, title transfer fees, and closing costs are subtracted from the sale price to determine your gross proceeds. This reduces your taxable gain dollar for dollar. On a typical home sale, agent commissions of 5 to 6 percent represent a significant reduction in the taxable gain. Keep records of all selling expenses for your tax return.

Can capital losses offset capital gains?

Yes, capital losses can offset capital gains dollar for dollar. If your losses exceed your gains, you can deduct up to $3,000 of net capital losses against ordinary income per year, with any remaining losses carried forward to future tax years. This strategy, called tax-loss harvesting, is commonly used to reduce tax liability on investment gains.

Do I owe state capital gains tax in addition to federal?

Most states tax capital gains as regular income, adding 3 to 13 percent depending on the state. Nine states have no income tax and therefore no state capital gains tax: Alaska, Florida, Nevada, New Hampshire (on earned income), South Dakota, Tennessee, Texas, Washington, and Wyoming. This calculator estimates federal tax only; consult your state tax guidelines for the full picture.

How do I report capital gains on my tax return?

Capital gains are reported on Schedule D of Form 1040, with transaction details on Form 8949. You must report the date acquired, date sold, proceeds, cost basis, and gain or loss for each transaction. For home sales qualifying for the primary residence exclusion, you may not need to report the sale if the gain is entirely excluded, but it is good practice to keep records in case of an audit.