When you sell an investment for more than you paid, the profit is a capital gain — and it is taxable. The rate you pay depends on how long you held the asset and your total income. Getting these details right can mean the difference between paying 15% and 37% on the same gain.
Short-Term vs. Long-Term Capital Gains
The holding period is the single most important factor in capital gains taxation.
- Short-term capital gains: Assets held for one year or less. Taxed as ordinary income at your regular federal income tax bracket rates (10%–37%).
- Long-term capital gains: Assets held for more than one year. Taxed at preferential rates of 0%, 15%, or 20%, depending on your income.
This distinction creates a powerful incentive to hold investments for at least a year and a day before selling.
2025 Long-Term Capital Gains Rates
| Rate | Single Filers | Married Filing Jointly | Head of Household |
|---|---|---|---|
| 0% | Up to $48,350 | Up to $96,700 | Up to $64,750 |
| 15% | $48,351 – $533,400 | $96,701 – $600,050 | $64,751 – $566,700 |
| 20% | Over $533,400 | Over $600,050 | Over $566,700 |
These thresholds apply to taxable income, not just the gain itself. Capital gains are stacked on top of ordinary income, so the rate depends on where the gain lands in the combined income picture.
Net Investment Income Tax (NIIT)
High earners also face the 3.8% Net Investment Income Tax (NIIT) on the lesser of net investment income or the amount by which modified adjusted gross income (MAGI) exceeds:
- $200,000 for single filers
- $250,000 for married filing jointly
This means the effective top rate on long-term gains can reach 23.8% (20% + 3.8%) at the federal level.
How Cost Basis Works
Your cost basis is what you paid for the asset. The capital gain is the difference between the sale price and the cost basis.
$$\text{Capital Gain} = \text{Sale Price} - \text{Cost Basis}$$
For example, if you bought 100 shares of a stock at $40 per share and sold them at $75 per share:
- Cost basis: 100 × $40 = $4,000
- Sale proceeds: 100 × $75 = $7,500
- Capital gain: $7,500 − $4,000 = $3,500
What Goes Into Cost Basis
Cost basis is not always just the purchase price. Adjustments can include:
- Brokerage commissions paid at purchase (add to basis) or at sale (subtract from proceeds)
- Stock splits: If a 2-for-1 split occurs, you have twice as many shares at half the per-share basis
- Reinvested dividends: Each reinvestment creates a new lot with its own basis and holding period
- Inherited assets: Use the fair market value on the date of death as the stepped-up basis — capital appreciation during the decedent’s lifetime is never taxed
Cost Basis Methods
When you own multiple lots of the same security purchased at different prices, you must choose a cost basis method to determine which shares you are selling:
| Method | How It Works | Best When |
|---|---|---|
| FIFO (First In, First Out) | Oldest shares sold first | Default for most brokerages |
| Specific Identification | You choose which lots to sell | You want to minimize gain or maximize loss |
| Average Cost | Average price across all lots | Common for mutual funds |
| LIFO (Last In, First Out) | Newest shares sold first | Less common; rarely optimal |
Specific identification gives the most control. By selecting high-basis lots, you can reduce the taxable gain. By selecting long-term lots, you can qualify for lower rates. You must identify the specific shares at the time of sale, not afterward.
Worked Example: Long-Term vs. Short-Term
Suppose you are a single filer with $60,000 in ordinary taxable income. You sold two investments in 2025:
Investment A (held 14 months): Bought at $10,000, sold at $18,000 — $8,000 long-term gain Investment B (held 8 months): Bought at $5,000, sold at $8,000 — $3,000 short-term gain
Investment A (Long-Term)
Your total taxable income including the long-term gain: $60,000 + $8,000 = $68,000. The long-term gain sits above the $48,350 threshold, so the entire $8,000 is taxed at 15%.
Tax on Investment A: $8,000 × 15% = $1,200
Investment B (Short-Term)
Short-term gains are taxed as ordinary income. Adding $3,000 to $60,000 = $63,000 total. The $3,000 sits in the 22% bracket.
Tax on Investment B: $3,000 × 22% = $660
Total capital gains tax: $1,860 — compared to $2,420 if both gains had been short-term.
Capital Losses and Loss Harvesting
Capital losses offset capital gains. If your losses exceed your gains, you can deduct up to $3,000 of net losses against ordinary income per year. Any remaining losses carry forward to future years indefinitely.
This creates an opportunity called tax-loss harvesting: strategically selling investments at a loss to offset gains, reducing your current-year tax bill. The loss carryforward can then offset future gains.
The Wash Sale Rule
The wash sale rule prevents investors from claiming a tax loss while maintaining essentially the same market position. If you sell a security at a loss and buy a substantially identical security within 30 days before or after the sale, the loss is disallowed.
The disallowed loss is not gone — it is added to the cost basis of the replacement shares, deferring the tax benefit rather than eliminating it. But the timing advantage is lost.
What triggers a wash sale:
- Selling stock and buying the same stock within the 30-day window
- Selling a fund and buying a nearly identical fund from the same family
- Selling an option at a loss and buying the underlying stock
What does not trigger a wash sale:
- Selling a S&P 500 ETF and buying a different S&P 500 ETF from a different fund family (different securities)
- Selling and repurchasing after the 31-day window
Note: The wash sale rule currently applies to stocks and securities but not to cryptocurrency under existing law. Crypto investors can sell at a loss and immediately repurchase without triggering a wash sale — though this may change with future legislation.
Reporting Capital Gains
All capital gains and losses are reported on Form 8949 and summarized on Schedule D of your Form 1040. Your brokerage issues a Form 1099-B showing proceeds and cost basis for each sale. Review this carefully — broker-reported cost basis can be incorrect, particularly for reinvested dividends or shares transferred between brokerages.
Key Takeaways
- Hold investments more than one year to qualify for long-term rates (0%, 15%, or 20%) instead of ordinary income rates up to 37%.
- Capital gains are stacked on top of ordinary income to determine which rate applies.
- Cost basis is what you paid; the gain is sale price minus basis.
- Use specific identification to optimize which lots you sell.
- Capital losses offset gains, and up to $3,000 per year can offset ordinary income.
- The wash sale rule disallows a loss if you repurchase the same security within 30 days.