Selling an investment for a profit feels great — until tax season arrives. Capital gains tax is one of the most significant costs investors face, and the amount you owe depends on several factors: how long you held the asset, your income level, the type of asset, and your overall tax situation.
This guide breaks down everything you need to know about capital gains tax, including how to calculate it manually, how to use a capital gains tax calculator, and strategies to legally minimize what you owe.
What Is Capital Gains Tax?
Capital gains tax is the tax you pay on the profit from selling a capital asset — such as stocks, bonds, real estate, cryptocurrency, or collectibles. You only owe this tax when you sell the asset. Unrealized gains (paper profits on assets you still hold) are not taxed.
The tax applies to the difference between your sale price and your cost basis (essentially what you paid for the asset, including purchase fees and commissions).
💡 Key Concept: You're taxed on the gain, not the total sale price. If you buy a stock for $10,000 and sell it for $15,000, you're taxed on the $5,000 gain — not the full $15,000.
Short-Term vs. Long-Term Capital Gains
The most important factor in determining your capital gains tax rate is how long you held the asset before selling:
Short-Term Capital Gains
Assets held for one year or less are subject to short-term capital gains tax. These gains are taxed at your ordinary income tax rate, which can be as high as 37% depending on your tax bracket. This makes short-term gains significantly more expensive than long-term gains for most taxpayers.
Long-Term Capital Gains
Assets held for more than one year qualify for preferential long-term capital gains tax rates. These rates are substantially lower than ordinary income rates:
| Taxable Income (Single) | Taxable Income (Married Filing Jointly) | Rate |
|---|---|---|
| $0 – $47,025 | $0 – $94,050 | 0% |
| $47,026 – $518,900 | $94,051 – $583,750 | 15% |
| $518,901+ | $583,751+ | 20% |
Additionally, high-income earners may owe the Net Investment Income Tax (NIIT) of 3.8% on top of capital gains, bringing the effective maximum rate to 23.8%.
How to Calculate Your Capital Gain
Calculating your capital gain is straightforward:
Capital Gain = Sale Price - Cost Basis
Your cost basis typically includes:
- The purchase price of the asset
- Commissions and fees paid to buy the asset
- Improvement costs (for real estate)
- Reinvested dividends (for mutual funds)
Example 1: Stock Sale
You bought 100 shares of stock at $50 per share, paying a $10 commission. You later sell all 100 shares at $80 per share, paying another $10 commission.
- Cost basis: (100 × $50) + $10 = $5,010
- Sale proceeds: (100 × $80) - $10 = $7,990
- Capital gain: $7,990 - $5,010 = $2,980
If you held the stock for more than one year and your income puts you in the 15% bracket, you'd owe $447 in capital gains tax. If you held it for less than a year and your ordinary rate is 24%, you'd owe $715.20.
Example 2: Real Estate
You bought a house for $300,000, spent $50,000 on renovations, and sold it for $500,000 with $20,000 in selling costs.
- Cost basis: $300,000 + $50,000 = $350,000
- Net sale price: $500,000 - $20,000 = $480,000
- Capital gain: $480,000 - $350,000 = $130,000
Note: If this was your primary residence for at least 2 of the 5 years before selling, you may qualify for the primary residence exclusion — excluding up to $250,000 (single) or $500,000 (married) of the gain from taxation.
Capital Losses: Offsetting Your Gains
Capital losses work in your favor. Here's how the IRS handles them:
- Offset gains first: Capital losses offset capital gains of the same type (short-term losses offset short-term gains, long-term losses offset long-term gains).
- Cross-offset if needed: If one type exceeds the other, the net loss offsets the other type.
- Deduct against ordinary income: If total losses exceed total gains, you can deduct up to $3,000 per year ($1,500 if married filing separately) against ordinary income.
- Carry forward indefinitely: Any unused losses carry forward to future tax years with no expiration.
💡 Strategy: Tax-loss harvesting involves selling losing investments before year-end to realize losses that offset your gains. You can immediately buy a similar (but not "substantially identical") investment to maintain your portfolio position. This strategy alone can save thousands in taxes annually.
Special Rules for Different Asset Types
Cryptocurrency
The IRS treats cryptocurrency as property, meaning the same capital gains rules apply. However, crypto has unique considerations:
- Trading crypto-to-crypto is a taxable event (e.g., trading Bitcoin for Ethereum triggers a gain or loss on the Bitcoin)
- Using crypto to purchase goods triggers a taxable event
- Mining income is taxed as ordinary income at the fair market value when received
- Staking rewards are taxable as income when received
Collectibles
Art, coins, stamps, wine, and other collectibles are subject to a maximum long-term capital gains rate of 28% (regardless of your income bracket), which is higher than the standard long-term rates.
Real Estate Investment Properties
Investment properties (not your primary residence) are subject to depreciation recapture. When you sell, the portion of the gain attributable to depreciation claimed over the years is taxed at a maximum rate of 25%, with the remaining gain taxed at standard capital gains rates.
How to Use a Capital Gains Tax Calculator
A capital gains tax calculator streamlines the process of estimating your tax liability. Here's how to use one effectively:
- Enter your purchase details: Input the original purchase price, date of purchase, and any associated fees.
- Enter your sale details: Input the sale price and date of sale.
- Specify your income bracket: The calculator uses your taxable income and filing status to determine the correct rate.
- Include any losses: Enter realized losses from other investments to see the net tax impact.
- Review the breakdown: The calculator should show your gain, applicable rate, estimated tax, and after-tax profit.
Tax-Saving Strategies for Capital Gains
- Hold investments longer than one year: This single decision can cut your tax rate from up to 37% to 0-20%. For most investors, patience is the most powerful tax strategy.
- Harvest tax losses: Sell losing positions to offset gains. Reinvest in similar but not identical assets to stay invested.
- Use tax-advantaged accounts: Gains in IRAs, 401(k)s, and HSAs are tax-deferred or tax-free. Maximize contributions to these accounts.
- Donate appreciated assets to charity: You can deduct the fair market value of donated assets and avoid paying capital gains on the appreciation.
- Consider the timing of sales: If you're close to a lower tax bracket, selling in a lower-income year can significantly reduce your rate.
- Use the primary residence exclusion: If selling your home, ensure you meet the 2-out-of-5-year ownership and use test to exclude up to $500,000 of gain.
Reporting Capital Gains on Your Tax Return
Capital gains and losses are reported on IRS Form 8949 and summarized on Schedule D of your tax return. Brokerages provide Form 1099-B with details of your sales, but always verify these against your own records — especially for crypto, where reporting may be incomplete.
For most taxpayers, capital gains calculations are straightforward. But if you have complex situations — multiple properties, significant crypto trading, or cross-border investments — consider consulting a tax professional.
Capital Gains Tax by State
Most states also tax capital gains, typically at your ordinary state income tax rate. However, some states have no income tax and therefore no state capital gains tax: Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming. If you live in a high-tax state like California (up to 13.3%), your combined federal and state rate can exceed 37%.
Calculate Your Capital Gains Tax
Use our free capital gains tax calculator to estimate your tax liability in seconds.
Open Capital Gains Calculator →Frequently Asked Questions
What is the difference between short-term and long-term capital gains tax?
Short-term capital gains apply to assets held for one year or less and are taxed at your ordinary income tax rate (10-37%). Long-term capital gains apply to assets held for more than one year and are taxed at preferential rates of 0%, 15%, or 20% depending on your income.
How do I calculate capital gains tax?
Subtract your cost basis (purchase price plus fees) from the sale price to find your capital gain. Then apply the appropriate tax rate based on how long you held the asset and your taxable income. Use a capital gains tax calculator to automate this process.
Can I deduct capital losses from my taxes?
Yes. Capital losses can offset capital gains dollar for dollar. If your losses exceed gains, you can deduct up to $3,000 per year ($1,500 if married filing separately) against ordinary income. Any remaining losses carry forward to future years indefinitely.
What is the capital gains tax rate for 2026?
Long-term capital gains rates for 2026 are 0%, 15%, and 20% based on taxable income thresholds. The 0% rate applies to taxable incomes up to approximately $47,025 (single) or $94,050 (married filing jointly). Short-term gains are taxed at ordinary income rates of 10-37%.
Do I pay capital gains tax on crypto?
Yes. In the United States, the IRS treats cryptocurrency as property. Selling, trading, or using crypto to purchase goods triggers capital gains tax. Exchanging one crypto for another is also a taxable event. The same short-term and long-term rules apply.