Capital Gains Tax Calculator
Estimate your capital gains tax liability based on your asset sale details and tax filing status
Your Capital Gains Tax Results
How to Calculate Capital Gains Tax: The Complete 2024 Guide
Capital gains tax is a tax on the profit you make from selling an asset that has increased in value. Whether you’re selling stocks, real estate, cryptocurrency, or collectibles, understanding how to calculate capital gains tax can help you plan your finances more effectively and potentially reduce your tax burden.
What Are Capital Gains?
Capital gains occur when you sell an asset for more than you paid for it. The difference between the sale price and the purchase price (adjusted for certain expenses) is your capital gain. For example:
- Purchase Price: $10,000 (what you paid for the asset)
- Sale Price: $15,000 (what you sold it for)
- Capital Gain: $5,000 (the profit)
If you sell the asset for less than you paid, you incur a capital loss, which can sometimes be used to offset other gains or reduce your taxable income.
Short-Term vs. Long-Term Capital Gains
The tax rate you pay depends on how long you held the asset before selling it:
| Holding Period | Tax Rate Type | 2024 Tax Rates (Federal) |
|---|---|---|
| 1 year or less | Short-term | Taxed as ordinary income (10%–37%) |
| More than 1 year | Long-term |
|
Long-term capital gains are generally taxed at lower rates than short-term gains, which is why long-term investing is often more tax-efficient.
Step-by-Step: How to Calculate Capital Gains Tax
Follow these steps to calculate your capital gains tax:
-
Determine Your Basis
Your basis is typically the original purchase price of the asset, but it can be adjusted for:
- Commissions or fees paid at purchase
- Improvements (for real estate)
- Depreciation (for rental properties)
- Stock splits or dividends reinvested
-
Calculate Your Realized Gain
Subtract your adjusted basis from the sale price (minus selling expenses):
Capital Gain = Sale Price — Selling Expenses — Adjusted Basis
-
Determine Your Holding Period
Count the time from the day after you acquired the asset to the day you sold it. If you held it for more than one year, it qualifies for long-term capital gains tax rates.
-
Apply the Correct Tax Rate
Use your filing status and taxable income to find your capital gains tax rate (see tables below).
-
Calculate State Taxes (If Applicable)
Some states (like California and New York) tax capital gains as ordinary income, while others (like Texas and Florida) have no state income tax.
-
Subtract Any Capital Losses
You can use capital losses to offset gains. If losses exceed gains, you can deduct up to $3,000 ($1,500 if married filing separately) from your ordinary income.
2024 Capital Gains Tax Rates (Federal)
| Filing Status | 0% Rate Applies To | 15% Rate Applies To | 20% Rate Applies To |
|---|---|---|---|
| Single | $0 — $47,025 | $47,026 — $518,900 | $518,901+ |
| Married Filing Jointly | $0 — $94,050 | $94,051 — $583,750 | $583,751+ |
| Married Filing Separately | $0 — $47,025 | $47,026 — $291,850 | $291,851+ |
| Head of Household | $0 — $63,000 | $63,001 — $551,350 | $551,351+ |
Note: These thresholds are based on taxable income, not just capital gains. Your ordinary income (salary, wages, etc.) is included in this calculation.
State Capital Gains Taxes
State taxes on capital gains vary widely. Here are a few examples:
- California: Taxes capital gains as ordinary income (rates up to 13.3%).
- New York: Rates range from 4% to 10.9% (plus NYC local tax if applicable).
- Texas & Florida: No state income tax (0% on capital gains).
- Washington: No state income tax, but a 7% tax on long-term capital gains over $250,000.
Check your state’s department of revenue for specific rates.
Special Cases & Exceptions
1. Primary Home Sale Exclusion
If you sell your primary home, you may exclude up to:
- $250,000 of gain if single
- $500,000 of gain if married filing jointly
Requirements: You must have owned and lived in the home for at least 2 of the last 5 years. See IRS Publication 523 for details.
2. Collectibles (28% Rate)
Gains from selling collectibles (art, coins, antiques, etc.) are taxed at a maximum rate of 28%, regardless of your income.
3. Qualified Small Business Stock (QSBS)
Up to 100% of gains from qualified small business stock may be excluded if held for >5 years (subject to limits).
4. Cryptocurrency
The IRS treats cryptocurrency as property, so capital gains rules apply. Short-term gains are taxed as ordinary income, while long-term gains use the standard rates.
How to Reduce Capital Gains Tax
Here are legal strategies to minimize your capital gains tax:
-
Hold Investments Longer
Wait until you’ve held the asset for over a year to qualify for lower long-term rates.
-
Use Tax-Loss Harvesting
Sell losing investments to offset gains. Up to $3,000 in excess losses can reduce ordinary income.
-
Contribute to Retirement Accounts
Maximize 401(k) or IRA contributions to lower your taxable income, which may keep you in a lower capital gains bracket.
-
Donate Appreciated Assets
Donating stock to charity avoids capital gains tax and may give you a deduction for the full market value.
-
Move to a Tax-Friendly State
States like Texas, Florida, and Nevada have no state capital gains tax.
-
Use a 1031 Exchange (Real Estate)
Defer taxes by reinvesting proceeds from a property sale into a similar property.
-
Invest in Opportunity Zones
Defer or eliminate capital gains tax by investing in designated economically distressed areas.
Common Mistakes to Avoid
- Forgetting to Adjust Basis: Not accounting for improvements, fees, or depreciation can lead to overpaying taxes.
- Misclassifying Short vs. Long-Term: Selling an asset just before the 1-year mark can cost you thousands in extra taxes.
- Ignoring State Taxes: Even if your federal tax is low, some states (like California) can take a big bite.
- Not Tracking Cost Basis: Failing to keep records of purchase prices, improvements, and fees can complicate tax filing.
- Overlooking Wash Sale Rules: Buying a “substantially identical” asset within 30 days of selling at a loss disqualifies the loss for tax purposes.
Capital Gains Tax vs. Ordinary Income Tax
Capital gains tax is separate from ordinary income tax (which applies to salaries, wages, and interest). Here’s how they compare:
| Feature | Capital Gains Tax | Ordinary Income Tax |
|---|---|---|
| Applies To | Profit from selling assets (stocks, real estate, etc.) | Salaries, wages, bonuses, interest, etc. |
| Tax Rates (2024) | 0%, 15%, or 20% (long-term); ordinary rates (short-term) | 10% to 37% (progressive brackets) |
| Holding Period Matters? | Yes (short-term vs. long-term) | No |
| Deductions Allowed? | Limited (e.g., $3,000 loss deduction) | Yes (standard or itemized) |
| State Tax Treatment | Varies (some states tax as ordinary income) | Taxed by most states |
When to Consult a Tax Professional
While this guide covers the basics, you may need professional help if:
- You have complex investments (e.g., options, futures, or international assets).
- You’re selling a business or rental property with depreciation recapture.
- You have large gains (over $500,000) and want to optimize taxes.
- You’re subject to the Net Investment Income Tax (NIIT) (3.8% surtax for high earners).
- You’re moving between states and need to allocate taxes correctly.
A Certified Public Accountant (CPA) or Enrolled Agent (EA) can help you navigate complex scenarios and identify deductions you might miss.