Calculate your federal capital gains tax on investments, real estate, crypto, and other assets. Covers short-term vs. long-term rates, the 3.8% Net Investment Income Tax (NIIT), and the home sale exclusion.
📈 Your sale
🧾 Your income
📊 Tax breakdown
| Item | Amount |
|---|
📋 2025 long-term capital gains rates
Uses 2025 IRS capital gains brackets. Short-term gains taxed as ordinary income. Long-term rates: 0%, 15%, or 20% based on taxable income. NIIT (3.8%) applies to net investment income if modified AGI exceeds $200k (single) / $250k (MFJ). Collectibles taxed at max 28%. State taxes use the rate entered. Home sale exclusion: $250k single / $500k MFJ if you owned and lived in the home 2 of the last 5 years. Results are estimates — consult a tax advisor for your situation.
How to use the Capital Gains Tax Calculator
This calculator determines your federal capital gains tax on any asset sale — stocks, crypto, real estate, collectibles, or a primary home — including whether the 3.8% Net Investment Income Tax applies to your situation.
- Enter your sale price and cost basis. The sale price is what you received for the asset. Your cost basis is what you originally paid, plus any fees or improvements. The difference is your capital gain (or loss).
- Select your holding period. If you held the asset for more than one year before selling, select long-term. One year or less is short-term. The difference in tax rates can be dramatic — long-term rates are 0%, 15%, or 20% versus ordinary income rates for short-term gains.
- Choose your asset type. Stocks, real estate, cryptocurrency, and collectibles each have specific tax treatment. Primary homes have a special exclusion of up to $250,000 (single) or $500,000 (married) of gain.
- Enter your ordinary income and filing status. Capital gains stack on top of your ordinary income to determine your long-term rate. Your income level determines whether you pay 0%, 15%, or 20% on long-term gains.
- Click Calculate to see your total tax, effective rate, net proceeds, and which bracket you fall into — plus strategies to reduce your bill.
Short-term vs. long-term capital gains
The most impactful decision in capital gains taxation is how long you hold an asset before selling. Assets held for one year or less generate short-term capital gains, taxed at the same rates as ordinary income (10%–37%). Assets held for more than one year generate long-term capital gains, taxed at much lower preferred rates of 0%, 15%, or 20%.
For a taxpayer in the 22% ordinary income bracket, the difference between selling a stock after 11 months versus 13 months can be the difference between paying 22% and paying 15% on the gain — a 7 percentage point swing. On a $50,000 gain, that’s $3,500 in additional taxes for selling just 2 months too early.
2025 long-term capital gains tax rates
| Rate | Single filers | Married filing jointly |
|---|---|---|
| 0% | Taxable income up to $48,350 | Taxable income up to $96,700 |
| 15% | $48,350 – $533,400 | $96,700 – $600,050 |
| 20% | Over $533,400 | Over $600,050 |
Note that “taxable income” here includes your capital gains. Your ordinary income fills the lower brackets first, and your capital gains are stacked on top. If your ordinary income is $40,000 (single), you have $8,350 of space in the 0% long-term capital gains bracket before gains start being taxed at 15%.
Special capital gains tax situations
Collectibles and art
Long-term gains on collectibles — art, antiques, coins, stamps, wine, and similar items — are taxed at a maximum rate of 28%, regardless of your income level. This is significantly higher than the standard 0%/15%/20% long-term rates that apply to stocks and real estate.
Cryptocurrency
The IRS treats cryptocurrency as property, not currency. Every sale, trade, or exchange of crypto is a taxable event subject to capital gains tax. Mining income and staking rewards are treated as ordinary income when received. Crypto held for more than one year qualifies for the same long-term rates as stocks — 0%, 15%, or 20%.
Primary home sale exclusion
If you sell your primary residence, you may be able to exclude up to $250,000 of gain (single) or $500,000 (married filing jointly) from federal capital gains tax. To qualify, you must have owned and used the home as your principal residence for at least 2 of the last 5 years before the sale. This exclusion is one of the most valuable tax benefits available to homeowners.
Net Investment Income Tax (NIIT)
High earners may owe an additional 3.8% Net Investment Income Tax on capital gains. This applies to the lesser of your net investment income or the amount by which your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). The NIIT means the effective top federal rate on long-term capital gains can reach 23.8% (20% + 3.8%) rather than just 20%.
Frequently asked questions
Do I owe capital gains tax if I reinvest the proceeds?
Yes. In a taxable brokerage account, capital gains tax is triggered by the sale itself — not by what you do with the proceeds. If you sell a stock at a $20,000 gain and immediately reinvest the proceeds in another stock, you still owe capital gains tax on the $20,000. The only way to defer capital gains taxes is through tax-advantaged accounts (IRAs, 401ks), like-kind exchanges for real estate (1031 exchanges), or Opportunity Zone investments.
What is tax-loss harvesting?
Tax-loss harvesting is the practice of selling investments that have declined in value to realize a loss, which can be used to offset capital gains from other sales. If your losses exceed your gains, up to $3,000 of net capital losses can be deducted against ordinary income each year. Additional losses can be carried forward to future tax years indefinitely. The key rule to watch: the wash-sale rule prohibits buying back a substantially identical security within 30 days before or after the sale.
How are inherited assets taxed when I sell them?
Inherited assets receive a “stepped-up” cost basis equal to the fair market value on the date of the original owner’s death. This means that unrealized gains accumulated during the deceased’s lifetime are never taxed — a significant benefit for heirs. If you inherit stock worth $100,000 that the original owner purchased for $10,000, your cost basis is $100,000. Any future gains are measured from that new basis, and if you sell the inherited asset, only gains above $100,000 are taxable.
Are there state capital gains taxes?
Yes, most states tax capital gains as ordinary income — there is no preferential state rate in most jurisdictions. A few exceptions: California taxes capital gains at the same rates as ordinary income up to 13.3%, making it one of the highest-tax states for investors. Some states like Florida, Texas, Nevada, and Washington have no state income or capital gains tax. Enter your state’s tax rate in this calculator to include state taxes in your estimate.
What is the capital gains tax on the sale of a rental property?
Selling a rental property involves both capital gains tax and depreciation recapture tax. The long-term capital gains rate (0%, 15%, or 20%) applies to the appreciation in value. However, the depreciation you’ve claimed on the property over the years is recaptured and taxed at a maximum rate of 25% — this is called unrecaptured Section 1250 gain. The combination often results in a higher effective tax rate on rental property sales than on stock sales. A 1031 like-kind exchange allows you to defer both taxes by reinvesting proceeds into another qualifying property.
How do I calculate my cost basis for stocks?
For stocks purchased in a single transaction, your cost basis is the purchase price plus any commissions or fees paid. For stocks purchased in multiple transactions (including through dividend reinvestment plans), you can use several accounting methods: FIFO (first in, first out), specific identification (choose which shares you’re selling), or average cost (only for mutual funds and some ETFs). Most brokerage firms track this for you and report it on your 1099-B — but you should verify the numbers, especially for older holdings acquired before 2012 when mandatory broker reporting began.
Strategies to reduce capital gains tax
- Hold investments for more than one year. The long-term/short-term distinction is the highest-leverage tax decision most investors can make. A 12-month-plus holding period can cut your rate from 22–37% to 0–20%.
- Use tax-loss harvesting strategically. Sell underperforming positions before year-end to offset gains, up to $3,000 against ordinary income annually with unlimited carryforward.
- Donate appreciated assets to charity. Donating stock or real estate directly to a qualified charity avoids capital gains tax entirely while generating a charitable deduction for the full fair market value — a double benefit.
- Invest through tax-advantaged accounts. Gains inside a Roth IRA are never taxed. Gains inside a traditional IRA or 401(k) are tax-deferred. Keeping high-turnover investments in tax-advantaged accounts and buy-and-hold investments in taxable accounts is a foundational tax efficiency strategy.
- Time sales in low-income years. If you’re between jobs, taking a sabbatical, or in early retirement with low income, you may temporarily fall into the 0% long-term capital gains bracket — allowing you to realize gains completely tax-free.