Capital Gains Tax Calculator
Calculate your federal capital gains tax for short-term and long-term investments — 2024 tax year.
Comparing your gain at different sale prices relative to your current inputs.
How to Use This Capital Gains Tax Calculator
Enter your purchase price (what you paid for the asset), your sale price (what you sold it for), and select whether you held it for more or less than one year. Add your annual income before this gain so the calculator can correctly place your gain in the right tax bracket. Optionally include commissions, fees, or property improvements as additional costs, and drag the slider to include your state's capital gains tax rate.
Hit Calculate to instantly see your federal and state tax owed, effective rate, net proceeds, and a full scenario comparison table.
Why Capital Gains Tax Matters
Capital gains tax is one of the most significant — and most misunderstood — taxes investors face. If you sell a stock you bought for $10,000 and it's now worth $40,000, you don't keep the full $30,000 gain. Depending on your situation, you could owe anywhere from $0 to over $7,000 in federal tax alone.
The distinction between short-term and long-term gains is enormous. Short-term gains (assets held 1 year or less) are taxed as ordinary income — up to 37% for high earners. Long-term gains enjoy preferential rates of 0%, 15%, or 20%, which is why holding an investment just a few extra months can save you thousands of dollars.
This matters for stocks, ETFs, mutual funds, real estate, crypto, collectibles, and business assets. A married couple earning $90,000 jointly who sells stock for a $50,000 long-term gain might owe $0 in federal capital gains tax — while a single earner in the same situation could owe $7,500. Filing status and income level change everything, which is why accurate planning is essential before you sell.
How It's Calculated
The calculator uses official 2024 IRS tax brackets for both short-term and long-term capital gains.
Long-term rates (2024): 0% up to $47,025 (single) / $94,050 (MFJ), 15% up to $518,900 (single) / $583,750 (MFJ), 20% above those thresholds. Additional 3.8% Net Investment Income Tax (NIIT) may apply to high earners (income above $200K single / $250K MFJ) — not included here.
Short-term rates: Your gain is added to ordinary income and taxed at regular income tax brackets (10% to 37%).
State Tax = Gain × State Rate
Total Tax = Federal Tax + State Tax
Net Proceeds = Gain − Total Tax
Tips & Common Mistakes
- Don't forget cost basis adjustments. Reinvested dividends, stock splits, and property improvements all change your cost basis — ignoring them leads to overpaying tax.
- Holding period timing matters. If you're at day 360, waiting 5 more days to sell could switch you from short-term to long-term and save you thousands.
- Tax-loss harvesting can offset gains. If you have losing positions, selling them before year-end creates a capital loss that offsets your gains dollar-for-dollar.
- State taxes vary wildly. California taxes capital gains as ordinary income (up to 13.3%), while states like Florida, Texas, and Nevada have zero state income tax.
- This is federal only (plus optional state). The 3.8% Net Investment Income Tax and Alternative Minimum Tax (AMT) are not included here — consult a tax professional for complex situations.
Frequently Asked Questions
What's the difference between short-term and long-term capital gains?
Short-term capital gains apply when you sell an asset you've held for one year or less. They're taxed at your ordinary income tax rate, which can be as high as 37%. Long-term gains apply to assets held more than one year and are taxed at preferential rates of 0%, 15%, or 20% depending on your income — significantly lower than ordinary income rates for most people.
Do I owe capital gains tax if I sold at a loss?
No — if your sale price is less than your purchase price (plus costs), you have a capital loss, not a gain. Capital losses can actually be beneficial: you can use them to offset capital gains, and if losses exceed gains, you can deduct up to $3,000 against ordinary income per year, carrying forward the rest to future years.
Is my primary home subject to capital gains tax?
Partially. The IRS allows a significant exclusion for primary residences: $250,000 for single filers and $500,000 for married couples filing jointly, as long as you've lived in the home for at least 2 of the past 5 years. Only gains above those thresholds are subject to capital gains tax. This calculator is best suited for investment assets rather than primary residence sales.
How does cryptocurrency capital gains work?
Crypto is treated as property by the IRS, not currency, so the same capital gains rules apply. Every sale, trade, or use of crypto to purchase goods is a taxable event. You must track your cost basis for each lot purchased, and short-term vs. long-term rules apply based on how long you held each specific unit before selling. This calculator works for crypto gains the same as stocks.