Trusted by millions of users

Capital Gains Tax Calculator

Calculate your federal capital gains tax on any asset sale. Compare short-term vs. long-term rates and see your net proceeds after tax.

$350K Avg. Home Price
6.75% Current Avg. Rate
$1,816 Avg. Monthly Payment
30yr Most Popular Term

Calculator

$
$
$

Your Results

Enter your values and click Calculate to see results

Short-Term vs. Long-Term Capital Gains

When you sell an asset for more than you paid for it, the profit is called a capital gain. The federal tax rate on that gain depends primarily on how long you held the asset before selling. This single factor — holding period — can mean the difference between paying 10% and 37% on the same profit.

Short-term capital gains apply to assets held for one year or less. These gains are taxed as ordinary income, meaning they're added to your other income and taxed at your marginal income tax bracket. In 2024, federal income tax brackets range from 10% to 37%. If you're in the 32% bracket, a short-term gain is taxed at 32% — the same as your salary or wages.

Long-term capital gains apply to assets held for more than one year. These gains receive preferential tax rates: 0%, 15%, or 20% depending on your taxable income and filing status. For 2024, single filers pay 0% on long-term gains if their total income (including the gain) is under $47,025; 15% up to $518,900; and 20% above $518,900. For married filing jointly, the thresholds are $94,050 (0%), $583,750 (15%), and above (20%).

The practical implication: if you're planning to sell an appreciated asset and you've held it for 11 months, waiting just one more month to cross the one-year threshold could cut your tax rate dramatically. On a $50,000 gain, the difference between 32% (short-term, 32% bracket) and 15% (long-term) is $8,500 in federal tax alone.

Net Investment Income Tax (NIIT)

High-income investors face an additional 3.8% surcharge on investment income called the Net Investment Income Tax. The NIIT applies to the lesser of your net investment income or the amount by which your modified adjusted gross income exceeds the threshold: $200,000 for single filers, $250,000 for married filing jointly, and $125,000 for married filing separately.

Net investment income includes capital gains, dividends, interest, rental income, and passive income from businesses. If you're a single filer with $150,000 in wages and $80,000 in long-term capital gains, your MAGI is $230,000 — exceeding the $200,000 threshold by $30,000. The NIIT applies to the lesser of $80,000 (net investment income) and $30,000 (excess over threshold), so you'd owe 3.8% × $30,000 = $1,140 in NIIT.

Combined with the 20% long-term capital gains rate, the effective top federal rate on long-term gains for high earners is 23.8%. For short-term gains at the 37% bracket plus NIIT, the combined rate reaches 40.8% — nearly as high as ordinary income.

Capital Gains on Real Estate

Real estate has its own set of capital gains rules with important exclusions. If you've owned and lived in your primary residence for at least two of the five years before selling, you can exclude up to $250,000 of gain from taxes ($500,000 for married filing jointly). This exclusion is one of the most valuable tax breaks in the tax code.

Investment properties don't qualify for this exclusion, but they offer another powerful tool: the 1031 exchange. Under Section 1031 of the tax code, you can defer capital gains taxes by reinvesting the proceeds from a property sale into a "like-kind" replacement property within a specific timeframe (45 days to identify, 180 days to close). The deferred gain carries over to the new property — you're not eliminating the tax, but postponing it indefinitely, potentially until death when a step-up in basis eliminates it entirely.

Depreciation recapture is another consideration for real estate investors. When you sell investment real estate, the depreciation you've taken over the years is "recaptured" and taxed at 25% — not at the lower long-term capital gains rates. This can significantly increase the effective tax rate on real estate gains.

Step-Up in Basis

One of the most powerful tax benefits in the U.S. tax code is the step-up in basis at death. When you inherit an asset, your cost basis "steps up" to the asset's fair market value on the date of death — wiping out all unrealized capital gains accumulated during the deceased's lifetime.

If your parent bought stock for $10,000 that grew to $500,000, and you inherit it, your basis becomes $500,000. You can immediately sell it for $500,000 and owe zero capital gains tax on the $490,000 of appreciation that occurred during your parent's lifetime. For investors with highly appreciated assets, this makes estate planning a critical component of tax strategy.

The step-up rule is under periodic political scrutiny — proposals to eliminate or modify it surface regularly. Staying informed about potential changes is important for high-net-worth investors with large unrealized gains.

Tax-Loss Harvesting and the Wash Sale Rule

Tax-loss harvesting is the practice of strategically selling assets at a loss to offset capital gains. If you have $20,000 in capital gains and $8,000 in capital losses, you only owe tax on the net $12,000. Capital losses offset same-type gains first (long-term losses vs. long-term gains, short-term vs. short-term), then cross over. If losses exceed gains, up to $3,000 of excess losses can offset ordinary income each year, with the remainder carried forward indefinitely.

The wash sale rule prevents you from claiming a tax loss if you buy a "substantially identical" security within 30 days before or after the sale. If you sell shares of a stock at a loss and buy the same stock back within 30 days, the loss is disallowed and added to the basis of the repurchased shares. To avoid the wash sale, you can buy a similar but not identical investment (different ETF tracking the same index from a different provider, for example) to maintain market exposure while capturing the tax loss.

Notably, the wash sale rule currently does not apply to cryptocurrencies, since the IRS treats crypto as property rather than securities. This allows crypto investors to sell at a loss and immediately repurchase — a significant tax advantage that may change with future legislation.

Crypto as Property: Capital Gains Rules

The IRS treats cryptocurrency as property for tax purposes, meaning every sale, exchange, or spending of crypto is a taxable event subject to capital gains rules. Buying Bitcoin, holding it for more than a year, and selling it at a profit generates long-term capital gains — taxed at the favorable 0%, 15%, or 20% rates. Holding for less than a year produces short-term gains taxed as ordinary income.

Crypto-to-crypto trades are also taxable events. Exchanging Bitcoin for Ethereum is treated as selling Bitcoin and using the proceeds to buy Ethereum. Each crypto transaction requires tracking the cost basis (purchase price) and calculating gain or loss. Most crypto exchanges now provide tax forms, but active traders may need dedicated crypto tax software to track cost basis accurately across hundreds of transactions.

State Capital Gains Taxes

In addition to federal taxes, most states tax capital gains as ordinary income. California has the highest state tax rate at 13.3%, meaning high-income California residents can face combined federal and state capital gains rates above 37% on long-term gains. Other high-tax states include New York (up to 10.9%), Oregon (9.9%), and Minnesota (9.85%).

Nine states have no income tax at all: Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming. Investors in these states pay only federal capital gains taxes. This disparity has led some high-income individuals to consider relocating before realizing large gains — though state tax authorities scrutinize domicile changes closely.

Frequently Asked Questions

How do I avoid capital gains tax?

You can't avoid capital gains tax entirely, but you can minimize it through several strategies: hold assets for at least one year to qualify for lower long-term rates; harvest tax losses to offset gains; use tax-advantaged accounts (IRA, 401k) where gains aren't taxed annually; take advantage of the primary residence exclusion on home sales; use 1031 exchanges for investment real estate; and make charitable donations of appreciated assets (you avoid capital gains and get a deduction for the full market value). With proper planning, many investors significantly reduce their effective capital gains tax rate.

What is the capital gains tax rate for 2024?

For 2024, long-term capital gains rates are 0%, 15%, or 20% for most assets, depending on your taxable income and filing status. Single filers pay 0% on gains if income is under $47,025; 15% from $47,025 to $518,900; and 20% above. High earners may also owe the 3.8% Net Investment Income Tax, bringing the top rate to 23.8%. Short-term gains are taxed as ordinary income at rates from 10% to 37%.

Do I owe capital gains tax if I reinvest the proceeds?

Yes. Reinvesting proceeds does not eliminate capital gains tax liability. The tax is triggered by the sale, not by what you do with the money afterward. The only exceptions are specific tax-deferral structures: 1031 exchanges allow real estate investors to defer gains by reinvesting in like-kind property, and Qualified Opportunity Zone investments allow temporary deferral. In tax-advantaged accounts (IRA, 401k, HSA), gains can be reinvested without immediate tax consequences — which is a core benefit of these accounts.