Capital Gains Tax Explained: What Investors Need to Know
Capital gains taxes catch many investors off-guard. You buy a stock, it goes up, you sell — and then you owe the IRS a cut of your profit. How much you owe depends critically on how long you held the investment before selling.
What Is a Capital Gain?
A capital gain is the profit from selling an asset for more than you paid for it.
If you buy 100 shares of a stock at $50/share ($5,000 total) and later sell them at $75/share ($7,500 total), your capital gain is $2,500.
What counts as a capital asset:
- Stocks and ETFs
- Mutual funds
- Bonds
- Real estate (with some exceptions)
- Cryptocurrency
- Business assets
- Collectibles, art, precious metals
What does NOT create a capital gain:
- Assets in tax-advantaged accounts (401k, IRA, Roth IRA) — taxes are handled differently there
- Inherited assets (they get a "step-up in basis" to their value at the time of inheritance)
Short-Term vs. Long-Term Capital Gains
This distinction is everything. The difference in tax rates can be enormous.
Short-Term Capital Gains
If you sell an asset you've held for one year or less, your profit is taxed as ordinary income — the same rate as your salary, wages, or self-employment income.
Depending on your income bracket, that's 10%, 12%, 22%, 24%, 32%, 35%, or 37%.
Long-Term Capital Gains
If you sell an asset you've held for more than one year, your profit is taxed at preferential long-term capital gains rates:
| Filing Status | 0% Rate | 15% Rate | 20% Rate |
|---|---|---|---|
| Single | Up to $47,025 | $47,026–$518,900 | Over $518,900 |
| Married Filing Jointly | Up to $94,050 | $94,051–$583,750 | Over $583,750 |
(2024 figures — adjust for inflation each year)
Most middle-class investors pay 0% or 15% on long-term gains. Compare that to short-term gains taxed at 22-24% for the same income level — holding for more than a year can literally halve your tax bill.
The Simple Rule: Hold Over One Year
The most actionable takeaway: if you're up on an investment and considering selling, check whether you've held it for at least 366 days. The difference between selling on day 364 vs. day 366 can save you thousands of dollars in taxes.
Example:
- You're in the 22% tax bracket
- You have a $10,000 gain
- Short-term: $2,200 in taxes
- Long-term (15% rate): $1,500 in taxes
- Difference: $700 just from waiting two days
Capital Losses and How to Use Them
Capital losses (selling assets for less than you paid) can offset capital gains dollar-for-dollar.
If you sell Stock A for a $5,000 gain and sell Stock B for a $3,000 loss in the same year, you only owe tax on $2,000 in net gains.
If your capital losses exceed your capital gains, you can deduct up to $3,000 per year against ordinary income, with any excess carrying forward to future years indefinitely.
Tax-Loss Harvesting
Tax-loss harvesting is intentionally selling investments at a loss to reduce your tax bill, while maintaining similar market exposure by immediately buying a similar (but not identical) investment.
Example: You have a $6,000 capital gain from selling a winning stock. You also hold an S&P 500 fund that's down $6,000 from your purchase price. You sell the losing fund, capture the $6,000 loss to offset your gain, and immediately buy a total stock market fund (similar but not identical — this avoids the wash sale rule).
The wash sale rule: You cannot claim a loss if you buy a "substantially identical" investment within 30 days before or after selling. Selling Vanguard's S&P 500 fund and buying Fidelity's S&P 500 fund is borderline. Selling Vanguard's S&P 500 fund and buying Vanguard's total stock market fund is generally considered acceptable.
Capital Gains in Retirement Accounts
The rules above apply to taxable (non-retirement) accounts. In retirement accounts, capital gains are treated differently:
- Traditional 401k / Traditional IRA: No capital gains tax while money is inside the account. All withdrawals are taxed as ordinary income.
- Roth 401k / Roth IRA: No capital gains tax, and no tax on qualified withdrawals at all. This makes Roth accounts extraordinarily powerful for investments you expect to grow significantly.
This is one major reason to hold high-growth investments in Roth accounts rather than taxable accounts.
The 0% Capital Gains Rate Strategy
If you're in a low-income year — say, between jobs, early in retirement, or in a year you converted to a lower-income lifestyle — you may qualify for the 0% long-term capital gains rate.
This opens a strategy called "capital gains harvesting": intentionally realizing long-term capital gains up to the 0% threshold, effectively resetting your cost basis without paying any tax.
For someone with $60,000 in total income (married filing jointly), they can realize up to $34,050 in long-term capital gains completely tax-free. This can dramatically reduce future taxes on appreciated assets.
Net Investment Income Tax (NIIT)
Higher earners also face an additional 3.8% Net Investment Income Tax on investment income (including capital gains) if their modified adjusted gross income exceeds $200,000 (single) or $250,000 (married). So the effective top rate on long-term gains for high earners is 23.8%, not 20%.
Real Estate Capital Gains
Your primary residence gets special treatment. If you've lived in your home for at least 2 of the last 5 years, you can exclude up to $250,000 in gains ($500,000 for married couples) from capital gains tax when you sell.
Investment properties and second homes don't get this exclusion. However, a 1031 exchange allows you to defer capital gains taxes on investment real estate by rolling the proceeds into a like-kind property within certain time limits.
Minimizing Capital Gains Taxes
Asset location: Hold investments with high turnover or that throw off short-term gains inside tax-advantaged accounts. Hold buy-and-hold index funds in taxable accounts.
Hold index funds: Index funds have low turnover, generating minimal capital gains distributions. Actively managed funds often distribute taxable gains annually even if you didn't sell anything.
Be strategic about timing: If you're near the end of the year and up significantly on an investment, consider whether waiting until January to sell would push the gain into next year's taxes (giving you more time to plan).
Use direct indexing or ETFs instead of mutual funds: Mutual funds can distribute capital gains to all shareholders even if you didn't sell, creating a tax bill even in years you didn't change your holdings. ETFs generally don't have this problem.
Understanding capital gains taxes is one of the few areas in personal finance where knowing the rules directly increases your after-tax returns with no additional risk.