Capital Gains Tax Calculator - Calculate Tax on Investment Profit

Calculate capital gains tax on investment profits. Short-term and long-term capital gains tax calculations.

About This Calculator

Capital Gains Tax Calculator - Calculate Capital Gains Tax

Calculate capital gains tax instantly with our free calculator. Determine short-term and long-term capital gains taxes on stocks, real estate, and other investments with accurate tax liability estimates.

Calculate Your Capital Gains Tax

Investment Details:

  • Purchase Price (Cost Basis): $[Input]
  • Sale Price: $[Input]
  • Holding Period: [Input] months/years
  • Annual Income: $[Input] (for tax bracket)
  • Filing Status: [Dropdown: Single, Married Filing Jointly, etc.]

[Calculate Button]

Your Capital Gains Tax Results:

  • Capital Gain/Loss: $[Amount]
  • Holding Period: [Short-term / Long-term]
  • Tax Rate: [Percentage]%
  • Capital Gains Tax: $[Amount]
  • After-Tax Profit: $[Amount]

Tax Optimization:

  • [Potential tax savings strategies]
  • [Alternative holding period recommendations]

What is Capital Gains Tax?

Capital Gains Tax is a tax on the profit from the sale of capital assets such as stocks, bonds, real estate, and other investments. It's only paid when you sell or dispose of the asset, not while you hold it.

How It Works

Basic Formula:

Capital Gain = Sale Price - Cost Basis
Capital Gains Tax = Capital Gain × Tax Rate

Example:

Purchase Stock: $1,000
Sell Stock: $1,500
Capital Gain: $500

Tax Rate: 15% (long-term)
Capital Gains Tax: $500 × 0.15 = $75
After-Tax Profit: $500 - $75 = $425

When Capital Gains Tax Applies

Taxable Events:

  • Selling stocks, bonds, or mutual funds
  • Selling real estate (not primary residence exclusion)
  • Selling valuable collectibles
  • Selling business assets
  • Some mutual fund distributions

Non-Taxable Events:

  • Price increases while holding (unrealized gains)
  • Inherited assets (step-up in basis)
  • Primary residence sale (under exclusion limits)
  • Tax-advantaged accounts (401k, IRA)
  • Municipal bond interest

Short-Term vs Long-Term Capital Gains

Short-Term Capital Gains

Assets held 1 year or less

Tax Treatment:

  • Taxed at ordinary income tax rates
  • Same as your regular income tax bracket
  • No special tax rates

Tax Rates (2024):

  • 10%, 12%, 22%, 24%, 32%, 35%, or 37%
  • Depends on your total taxable income

Example:

Bought stock: $1,000
Sold 8 months later: $1,300
Short-term gain: $300

Your tax bracket: 24%
Tax owed: $300 × 0.24 = $72

Long-Term Capital Gains

Assets held more than 1 year

Tax Treatment:

  • Special lower tax rates
  • 0%, 15%, or 20% based on income
  • Significant tax savings for most investors

Tax Rates (2024):

Filing Status 0% Rate 15% Rate 20% Rate
Single Up to $47,025 $47,026 - $518,900 Over $518,900
Married Joint Up to $94,050 $94,051 - $583,750 Over $583,750
Head of Household Up to $63,000 $63,001 - $551,350 Over $551,350

Example:

Bought stock: $1,000
Sold 18 months later: $1,300
Long-term gain: $300

Your income (Married Joint): $150,000
Tax rate: 15%
Tax owed: $300 × 0.15 = $45

Savings vs Short-term: $72 - $45 = $27

Cost Basis

What is Cost Basis?

Cost Basis is the original value of an asset for tax purposes, typically the purchase price, adjusted for stock splits, dividends, and return of capital distributions.

Calculating Cost Basis

Basic Purchase:

Cost Basis = Purchase Price + Commissions + Fees

Example:

Stock Price: $1,000
Commission: $10
Total Cost Basis: $1,010

Adjusted Cost Basis:

- Add: Commissions, fees, improvement costs
- Subtract: Depreciation, return of capital
- Reinvested dividends: Added to basis

Reinvested Dividends Example:

Purchase: $1,000
Dividends reinvested: $100
Cost Basis: $1,100

Special Cost Basis Situations

Inherited Assets:

  • Step-up (or step-down) to fair market value at date of death
  • Basis becomes market value when inherited
  • Can significantly reduce capital gains tax

Example:

Original Purchase (by parent): $10,000
Value at inheritance: $50,000
Your basis: $50,000 (step-up)
If you sell for $55,000, gain is only $5,000

Gifted Assets:

  • Keep donor's original basis
  • Carryover basis from donor
  • Different rules if selling at loss

Capital Gains Tax Rates by Asset Type

Collectibles

Tax Rate: 28% maximum (long-term)

Includes:

  • Art, antiques
  • Coins, stamps
  • Precious metals
  • Gems, jewelry
  • Fine wine

Example:

Buy gold coin: $1,000
Sell 2 years later: $1,500
Gain: $500
Tax: $500 × 0.28 = $140

Real Estate

Primary Residence Exclusion:

  • Single: $250,000 exclusion
  • Married: $500,000 exclusion
  • Must live in home 2 of last 5 years
  • Once every 2 years

Investment Property:

  • Subject to capital gains tax
  • Depreciation recapture (25% rate on depreciation taken)
  • Long-term rates on remaining gain

Example:

Investment Property:
Purchase: $200,000
Depreciation taken: $50,000
Sell: $300,000
Total gain: $100,000

Depreciation recapture: $50,000 × 25% = $12,500
Remaining gain: $50,000 × 15% = $7,500
Total tax: $20,000

Small Business Stock

Section 1202 Stock:

  • Qualified small business stock
  • Exclusion of 50%, 75%, or 100% of gain
  • Must hold more than 5 years
  • Specific requirements apply

Capital Losses

Using Capital Losses

Offset Gains:

  • Capital losses offset capital gains
  • No limit on offsetting gains
  • Reduces total capital gains tax

Example:

Stock A gain: $1,000
Stock B loss: $300
Net gain: $700
Tax on $700 instead of $1,000

Deducting Excess Losses

Annual Limit:

  • Up to $3,000 per year ($1,500 married filing separately)
  • Against ordinary income
  • Carry forward unlimited losses to future years

Example:

Total capital gains: $500
Total capital losses: $5,000
Net loss: $4,500

Offset $500 gains = $0
Deduct $3,000 against ordinary income
Carry forward $1,500 to next year

Wash Sale Rule

Rule:

  • Cannot claim loss if you buy substantially identical security within 30 days before or after sale
  • Loss is disallowed and added to new purchase basis
  • Applies to stocks, securities, mutual funds

Example:

Sell stock at loss: -$1,000
Buy same stock 20 days later: Loss disallowed
$1,000 loss added to new purchase cost basis

Net Investment Income Tax (NIIT)

Additional 3.8% Tax

Applies to:

  • Individuals with income over $200,000
  • Married couples filing jointly with income over $250,000
  • Investment income including capital gains

Calculation:

Lesser of:
- Net investment income
- Amount by which MAGI exceeds threshold
× 3.8%

Example:

Single filer with $220,000 MAGI:
Threshold: $200,000
Excess: $20,000
Capital gains: $10,000

NIIT = $10,000 × 3.8% = $380

Tax-Loss Harvesting

What is Tax-Loss Harvesting?

Strategy: Sell investments at a loss to offset gains and reduce taxes

Benefits:

  • Offset capital gains dollar-for-dollar
  • Deduct up to $3,000 against ordinary income
  • Carry forward excess losses
  • Maintain market exposure

How It Works

Example:

Portfolio:
- Stock A: +$5,000 gain (held long-term)
- Stock B: -$2,000 loss (held long-term)
- Stock C: -$4,000 loss (held long-term)

Without harvesting:
Gain: $5,000
Tax (15%): $750

With harvesting:
Net gain: $5,000 - $2,000 - $4,000 = -$1,000 loss
No capital gains tax
Deduct $1,000 against ordinary income
Tax savings: $750 + (ordinary tax rate × $1,000)

Important Considerations

Watch out for:

  • Wash sale rules (don't buy identical security within 30 days)
  • Transaction costs (commissions, spreads)
  • Short-term vs long-term holding periods
  • Market timing risk

State Capital Gains Taxes

State Taxation

Most states: Tax capital gains as ordinary income

No state income tax:

  • Alaska
  • Florida
  • Nevada
  • South Dakota
  • Texas
  • Washington
  • Wyoming

Special treatment:

  • Some states have lower capital gains rates
  • Some states offer exclusions or deductions

Example:

Federal capital gains tax: $750 (15%)
State tax (9.3% California): $465
Total tax: $1,215

Capital Gains Tax Calculation Examples

Example 1: Stock Sale (Long-Term)

Scenario:

  • Bought: 100 shares at $50 = $5,000
  • Commission: $10
  • Held: 2 years
  • Sold: 100 shares at $75 = $7,500
  • Commission: $10
  • Filing: Single, $100,000 taxable income

Calculation:

Cost Basis: $5,000 + $10 = $5,010
Sale Proceeds: $7,500 - $10 = $7,490
Capital Gain: $7,490 - $5,010 = $2,480

Holding: 2 years = Long-term
Tax Rate: 15% (income under $518,900)
Tax: $2,480 × 0.15 = $372
After-Tax Profit: $2,480 - $372 = $2,108

Example 2: Real Estate Investment

Scenario:

  • Purchase: $300,000
  • Improvements: $50,000
  • Depreciation taken: $40,000
  • Sold: $500,000
  • Selling costs: $30,000
  • Held: 5 years

Calculation:

Cost Basis: $300,000 + $50,000 = $350,000
Adjusted Basis: $350,000 - $40,000 = $310,000
Amount Realized: $500,000 - $30,000 = $470,000
Total Gain: $470,000 - $310,000 = $160,000

Depreciation Recapture: $40,000 × 25% = $10,000
Remaining Gain: $120,000 × 15% = $18,000
Total Tax: $28,000
After-Tax Profit: $160,000 - $28,000 = $132,000

Example 3: Multiple Sales with Gains and Losses

Scenario:

  • Stock A: +$8,000 gain (long-term)
  • Stock B: -$3,000 loss (long-term)
  • Stock C: -$2,000 loss (short-term)
  • Stock D: +$1,000 gain (short-term)
  • Filing: Married Joint, $180,000 taxable income

Calculation:

Long-term:
  Gains: $8,000
  Losses: $3,000
  Net long-term: $5,000

Short-term:
  Gains: $1,000
  Losses: $2,000
  Net short-term: -$1,000

Total Net Gain: $5,000 - $1,000 = $4,000

Tax:
Long-term rate: 15%
Tax: $4,000 × 0.15 = $600
After-Tax Profit: $3,400

Strategies to Minimize Capital Gains Tax

1. Hold Long-Term

Benefit: Lower tax rates

  • Long-term: 0%, 15%, or 20%
  • Short-term: Up to 37%
  • Hold more than 1 year for long-term treatment

2. Tax-Loss Harvesting

Benefit: Offset gains with losses

  • Sell losing investments
  • Offset gains dollar-for-dollar
  • Deduct up to $3,000 against ordinary income

3. Use Tax-Advantaged Accounts

Accounts:

  • 401(k), 403(b)
  • Traditional IRA, Roth IRA
  • 529 education plans
  • HSAs (for investments)

Benefit: Tax-deferred or tax-free growth

4. Time Your Sales

Strategies:

  • Spread gains over multiple years
  • Realize losses in high-income years
  • Realize gains in low-income years
  • Watch your tax bracket

5. Charitable Donations

Donate appreciated assets:

  • Avoid capital gains tax
  • Deduct fair market value
  • Support charity

Example:

Donate stock worth $10,000 (original cost: $2,000)
Avoid tax on $8,000 gain
Deduct $10,000 (if itemizing)

6. Primary Residence Exclusion

Requirements:

  • Live in home 2 of last 5 years
  • Own the home
  • Used as primary residence
  • Once every 2 years

Exclusion:

  • Single: $250,000
  • Married: $500,000

How do I calculate capital gains tax?

Calculate your gain (Sale Price - Cost Basis), determine if short-term (<1 year) or long-term (>1 year), multiply gain by appropriate tax rate. Short-term: ordinary income rates. Long-term: 0%, 15%, or 20% based on income.

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

Short-term: Assets held 1 year or less, taxed at ordinary income rates (up to 37%). Long-term: Assets held more than 1 year, taxed at lower rates (0%, 15%, or 20%).

How can I avoid paying capital gains tax?

Hold assets more than 1 year for lower rates, use tax-loss harvesting, invest in tax-advantaged accounts (IRA, 401k), use primary residence exclusion ($250K/$500K), donate appreciated assets to charity.

Do I have to pay capital gains tax if I reinvest the money?

Generally, yes. Reinvesting doesn't avoid capital gains tax. Exceptions: 1031 exchange for real estate, reinvesting within tax-advantaged accounts like IRA or 401(k).

What is the capital gains tax rate for 2024?

Long-term rates: 0% (income up to $47,025 single/$94,050 joint), 15% (up to $518,900 single/$583,750 joint), 20% (above those amounts). Short-term rates: Same as ordinary income tax brackets (10-37%).

How does cost basis affect capital gains tax?

Higher cost basis = lower taxable gain = lower tax. Include purchase price, commissions, fees, improvements. Reinvested dividends increase basis. Inherited assets get step-up (or step-down) to market value at date of death.

Can I offset capital gains with capital losses?

Yes, capital losses offset capital gains dollar-for-dollar. If losses exceed gains, deduct up to $3,000 per year against ordinary income ($1,500 married filing separately). Carry forward excess losses indefinitely.

Do I pay capital gains tax on inherited property?

Generally no, or significantly reduced. Inherited assets get stepped-up basis to market value at date of death. If you inherit property worth $500,000 and sell for $500,000, no capital gains tax. If you sell for $550,000, only $50,000 gain is taxed.


Practice Examples

Example 1: Calculate Capital Gains Tax

Bought: Stock for $2,000 Sold: For $2,600 after 18 months Filing: Single, $80,000 taxable income

Calculation:

Gain: $2,600 - $2,000 = $600
Holding: 18 months = Long-term
Tax Rate: 15% (income under $47,025)
Tax: $600 × 0.15 = $90
After-Tax Profit: $510

Example 2: Short-Term vs Long-Term

Bought: Stock for $5,000 Sold: For $6,500 Filing: Married Joint, $200,000 taxable income

If sold after 8 months (Short-term):

Gain: $1,500
Tax Rate: 24% (ordinary income bracket)
Tax: $1,500 × 0.24 = $360

If sold after 14 months (Long-term):

Gain: $1,500
Tax Rate: 15% (long-term capital gains)
Tax: $1,500 × 0.15 = $225
Savings: $135

Related Calculators

  • ROI Calculator
  • Net Worth Calculator
  • Investment Calculator
  • Tax Bracket Calculator
  • Profit Margin Calculator

Need Help? Our capital gains tax calculator is perfect for investors, traders, real estate owners, and anyone selling investments. Calculate your capital gains tax now!

Frequently Asked Questions

Related Calculators

Investment Calculator - Calculate Investment Returns

Calculate your investment returns with our free investment calculator. Plan your portfolio growth with compound interest, contributions, and investment strategies.

Savings Calculator - Calculate Savings Growth

Calculate your savings growth instantly with our free savings calculator. Plan your financial future with compound interest, regular deposits, and goal tracking.

Retirement Calculator - Plan Your Retirement Savings

Calculate how much you need to save for retirement. Plan your retirement savings goals and see if you are on track.

ROI Calculator - Calculate Return on Investment

Calculate ROI (Return on Investment) instantly. Determine the profitability of investments and compare different opportunities.

Budget Calculator - Plan Your Monthly Budget

Plan your budget with our free budget calculator. Track income, expenses, and savings to achieve your financial goals with detailed budget analysis using the 50/30/20 rule.

Loan Payoff Calculator - Calculate Early Loan Payoff

Calculate loan payoff with extra payments. See how much time and interest you can save. Generate amortization schedules. Perfect for mortgages and loans.

Mortgage Calculator - Calculate Monthly Mortgage Payments

Calculate your monthly mortgage payment instantly. Includes taxes, insurance, PMI, and amortization schedule. Free mortgage calculator.

Salary Calculator - Calculate Your Salary

Calculate your salary instantly with our free salary calculator. Convert hourly to annual salary, compare pay periods, and understand your true earnings.

VAT Calculator - Calculate VAT (Value Added Tax)

Calculate VAT (Value Added Tax) instantly with our free VAT calculator. Compute tax-inclusive and tax-exclusive prices for any VAT rate.

Take Home Pay Calculator - Calculate Your Net Income

Calculate your take-home pay instantly with our free take-home-pay calculator. Estimate your net pay after federal taxes, state taxes, Social Security, and Medicare deductions.

Income Tax Calculator - Calculate Your 2024 Income Tax

Calculate your income tax instantly with our free income tax calculator. Based on 2024 tax brackets, see your federal tax, state tax, effective rate, and marginal rate.

Break-Even Calculator - Calculate Break-Even Point

Calculate break-even point for your business instantly. Find how many units you need to sell to cover costs. Essential for entrepreneurs.

Compound Interest Calculator - Calculate Investment Growth

Calculate compound interest instantly. See how your investments grow over time. Include regular contributions and various compounding periods.

Investment Profit Calculator - Calculate ROI & Returns

Calculate investment profit instantly. ROI calculator, percentage gain, and total return. Perfect for stocks, crypto, and business investments.

Savings Goal Calculator - Plan Your Savings

Calculate savings to reach your goals instantly. Plan for vacations, emergencies, and major purchases. See how much to save monthly.

Margin Calculator - Calculate Profit Margin

Calculate profit margin percentages for business pricing.

Profit Margin Calculator - Calculate Profit Margins

Calculate profit margins, gross margin, and net margin.

CAGR Calculator - Calculate Compound Annual Growth Rate

Calculate CAGR (Compound Annual Growth Rate) for investments. Determine annual growth rate over multiple periods.