📈Capital Gains Tax Calculator
Calculate taxes on your investment profits from stocks, real estate, and cryptocurrency.
Frequently Asked Questions
What are capital gains taxes?
Capital gains tax is paid on the profit from selling an investment like stocks, real estate, or crypto. If you buy stock for $10,000 and sell for $15,000, you have a $5,000 capital gain. The tax rate depends on how long you held the asset: short-term (under 1 year) is taxed as ordinary income (10-37%), while long-term (1+ years) gets preferential rates (0%, 15%, or 20%).
What's the difference between short-term and long-term capital gains?
Short-term gains (assets held under 1 year) are taxed as ordinary income at your regular tax rate (10-37%). Long-term gains (held over 1 year) get special lower rates: 0% if you're in the 10-12% tax brackets, 15% for most people, and 20% for high earners ($492,300+ single, $553,850+ married). Holding investments over a year can save 5-17% in taxes on your profits.
Do I pay capital gains tax on cryptocurrency?
Yes! The IRS treats cryptocurrency as property, not currency. Selling, trading, or even spending crypto triggers capital gains tax. If you bought Bitcoin for $10,000 and sold for $15,000, you owe tax on the $5,000 gain. Trading one crypto for another (like Bitcoin for Ethereum) also creates a taxable event. Keep detailed records of all transactions including the purchase price (cost basis) and sale price.
Can I offset capital gains with capital losses?
Yes! Capital losses offset capital gains dollar-for-dollar. If you have $10,000 in gains and $4,000 in losses, you only pay tax on $6,000. If losses exceed gains, you can deduct up to $3,000 against ordinary income annually, carrying forward remaining losses to future years. This 'tax-loss harvesting' strategy can significantly reduce your tax bill. Match short-term losses with short-term gains for maximum benefit.
How can I avoid or reduce capital gains tax?
Strategies to minimize capital gains tax: 1) Hold investments over 1 year for lower long-term rates, 2) Harvest tax losses to offset gains, 3) Use retirement accounts (401k, IRA) where gains grow tax-free, 4) Gift appreciated assets to family in lower tax brackets, 5) Donate appreciated stock to charity (avoid tax and get deduction), 6) For real estate, use 1031 exchange to defer taxes, 7) Time sales to stay in lower tax brackets.
Why Use This Calculator?
Long-Term vs Short-Term Rate Comparison
Calculate tax difference between long-term (0/15/20% on assets held >1 year) and short-term capital gains (taxed as ordinary income at 10-37%). Holding investments 1+ year saves $1,700-1,700 on $10k gain.
0% Capital Gains Bracket Optimization
Identify if you qualify for 0% long-term rate ($47,025 single/$94,050 married total income in 2024). Strategic timing of sales in low-income years or retirement can eliminate capital gains taxes entirely.
Net Investment Income Tax (NIIT)
Calculate additional 3.8% NIIT on capital gains if modified AGI exceeds $200k single/$250k married. A $50k gain at $220k income adds $1,900 NIIT on top of 15-20% capital gains tax.
Tax-Loss Harvesting Savings
See how capital losses offset gains dollar-for-dollar, plus $3,000 annually against ordinary income. A $10k loss offsets $10k gain (saving $1,500-2,000 tax) or reduces regular income tax by $660-1,110.
Primary Residence Exclusion Benefits
Calculate tax savings from $250k single/$500k married home sale exclusion. Selling primary residence with $400k gain = $0 tax for married couple vs $60-80k tax on investment property.
State Capital Gains Tax Impact
Factor in state taxes (0-13.3%) on top of federal. California adds full state rate to capital gains while some states (TX, FL, WA) have none. $100k gain in CA = $13,300 more tax than TX.
Step-by-Step Guide
Determine Holding Period
Calculate exact holding period from purchase to sale date. Long-term (>365 days) qualifies for preferential 0/15/20% rates. Short-term (≤365 days) taxed as ordinary income at 10-37%.
Example:
Example: Bought 3/15/2023, sold 3/16/2024 = long-term. Sold 3/14/2024 = short-term (364 days)
Calculate Cost Basis
Determine original purchase price plus commissions, fees, and reinvested dividends. Higher cost basis reduces taxable gain. Don't forget to add improvement costs for real estate or acquisition fees for investments.
Example:
Example: Bought stock $10k + $50 commission + $500 reinvested dividends = $10,550 basis
Compute Gross Capital Gain
Subtract cost basis from sale proceeds (minus selling costs like commissions). This is your taxable capital gain before applying tax rates.
Example:
Example: Sold for $25,000 - $100 commission - $10,550 basis = $14,350 capital gain
Input Total Taxable Income
Enter your other income (wages, interest, dividends) to determine which capital gains bracket you fall into. Capital gains push you through brackets, affecting rate applied.
Example:
Example: $60k salary + $14,350 gain = $74,350 total, determines 15% long-term rate
Apply Correct Tax Rate
Long-term: 0% if total income under $47,025 single/$94,050 married, 15% up to $518,900/$583,750, 20% above. Short-term: use regular income tax brackets (10-37%).
Example:
Example: $74k total income = 15% long-term rate, but 22% if short-term
Calculate NIIT if Applicable
Add 3.8% Net Investment Income Tax if modified AGI exceeds $200k single/$250k married. Applied to lesser of net investment income or amount over threshold.
Example:
Example: $220k AGI, $14,350 gain = 3.8% × $14,350 = $545 additional NIIT
Apply Capital Losses
Capital losses offset gains dollar-for-dollar with no limit. Excess losses offset up to $3,000 ordinary income annually, remainder carries forward indefinitely to future years.
Example:
Example: $14,350 gain - $8,000 loss = $6,350 net gain taxed. Or $20k loss - $14,350 gain = $5,650 loss, use $3k this year, $2,650 next year
Factor in State Taxes
Add state capital gains tax (same as income tax rate in most states). California 9.3%, New York 6.5%, no tax in TX/FL/WA. Calculate combined federal + state for total tax liability.
Example:
Example: $14,350 gain: 15% federal ($2,153) + 9.3% CA ($1,335) = $3,488 total tax
Consider Primary Residence Exclusion
For home sales, apply $250k single/$500k married exclusion if lived in 2+ of last 5 years. Gain above exclusion is taxable. Multiple exclusion uses require 2+ years between sales.
Example:
Example: Married couple, $600k home gain - $500k exclusion = $100k taxable gain
Plan for Estimated Tax Payments
If realizing large gains, make quarterly estimated tax payment to avoid underpayment penalty. Pay by end of quarter when gain realized (Q1-Q4 deadlines: April, June, September, January).
Example:
Example: $50k gain in March, pay $7,500 estimated tax by April 15 (15% rate)
Expert Tips & Strategies
Hold Investments 1+ Year for Rate Difference
Patience pays - holding 366 days vs 364 days can save 7-22% in taxes. $50k gain: short-term at 24% = $12,000 tax, long-term at 15% = $7,500 tax, saving $4,500. Set calendar reminders before 1-year anniversary to avoid premature selling.
Harvest Losses to Offset Gains
Tax-loss harvesting: sell losing positions to offset winning positions' taxes. $30k gains + $15k losses = $15k net taxable. Saves $2,250-4,500 depending on rate. Watch 30-day wash sale rule - can't rebuy same/substantially identical security.
Time Sales for Low-Income Years
If taking sabbatical, between jobs, or retiring early, time large asset sales for 0% capital gains bracket years. Earning $40k plus $30k LTCG = $70k income, first $7k of gains at 0%, rest 15% (vs 15-20% in high-earning years). Strategic multi-year planning.
Manage NIIT with 401k Contributions
NIIT threshold ($200k/$250k) is Modified AGI. Maxing 401k ($23k) can keep you under threshold. At $205k income, $23k 401k drops AGI to $182k, avoiding 3.8% NIIT on investment income, saving $1,140 on $30k gains.
Don't Let Tax Tail Wag Investment Dog
Never hold bad investments just for tax reasons. Saving 15-20% on gains means losing 80-85% if investment continues dropping. If investment thesis broken, sell and take tax hit. Tax efficiency matters, but not more than protecting capital.
Qualified Small Business Stock Exclusion
QSBS allows excluding 100% of gains (up to $10 million or 10× basis) on certain small business stock held 5+ years. If you have startup equity, verify QSBS eligibility - can save $2 million+ in taxes on successful exit.
Donor-Advised Funds for Large Gains
Instead of selling appreciated stock and donating cash, donate stock directly to DAF. Avoid capital gains tax AND get charitable deduction at FMV. $50k stock with $10k basis: save $6k capital gains tax + $11k-18.5k from deduction.
Step-Up Basis for Inherited Assets
Inherited assets get step-up to FMV at death, erasing all lifetime gains. $10k stock now worth $500k inherited = $500k new basis, $0 tax if sold immediately. Coordinate with elderly parents on gifting vs inheritance - step-up can save $75k-100k on $500k gain.
Common Mistakes to Avoid
✓ Better approach: Selling at 11 months instead of waiting 1+ year triggers short-term rates (10-37%) instead of long-term (0-20%). On $40k gain at 24% bracket, that's $9,600 tax vs $6,000 - costs $3,600 for 30-day impatience. Set reminders for 1-year anniversaries before selling.
✓ Better approach: Calculating federal 15% tax but forgetting state's 5-13% additional. California $50k gain = $7,500 federal + $6,650 state = $14,150 total (28.3% effective), not 15%. Always factor state taxes into selling decisions, especially for large gains.
✓ Better approach: Using wrong cost basis overstates gain and overpays taxes. Forgetting to include reinvested dividends, stock splits, or commissions in basis. $50k sale - $10k basis (missing $5k reinvested dividends) = $40k taxable vs actual $35k = $750-1,000 overpaid tax. Keep meticulous records.
✓ Better approach: Having $30k in unrealized losses but not harvesting them. $3k loss offsets ordinary income at 22-37% ($660-1,110 annual savings). Over 10 years of not harvesting, that's $6,600-11,100 wasted savings. Harvest losses annually even without gains - carry forward indefinitely.
✓ Better approach: Selling home before living in it 2 of last 5 years loses $250k/$500k exclusion. Renting out home for 3+ years then selling means gain is partially taxable. Selling too early on $400k gain costs married couple $60k-80k in unnecessary taxes. Plan occupancy carefully.
✓ Better approach: Realizing $100k gain in one year instead of spreading over 2 years pushes income over $200k/$250k NIIT threshold. $100k at $220k AGI = 18.8% rate (15% + 3.8%). Splitting to $50k/year at $170k AGI = 15% rate, saves $1,900 per year ($3,800 total) from avoiding NIIT.
✓ Better approach: Taking $40k gain in 2024 and $30k loss in 2025 wastes offset opportunity. Loses $4,500-6,000 in tax savings from offset, plus delays loss benefit by a year. Strategically realize gains and losses together when possible - losses offset gains with no dollar limit.
Learn More
Complete Budgeting Guide
Master the 50/30/20 rule and other proven budgeting strategies to manage your money effectively.
📊Financial Planning Basics
Learn the fundamentals of financial planning, from emergency funds to retirement savings.
⭐Credit Score Improvement Guide
Boost your credit score to qualify for better rates and terms on all financial products.