When You Actually Owe Capital Gains Tax on Your Investments
You pay capital gains tax in the year you sell the investment, not when you buy it or when it grows in value
The tax bill arrives when you realize the gain — meaning you sell the asset and lock in the profit. Until you sell, the growth is just on paper and you owe nothing. The moment the sale completes and you have cash or a new asset in hand, that tax year counts as the year you owe tax on the difference between what you paid and what you received.
The IRS wants to know about the sale in the year it happened. If you sell stock in March 2024, you report it on your 2024 tax return, filed in early 2025. If you sell in December 2024, same thing — 2024 return. The timing of when you actually pay the IRS (April 15 or whenever you file) is separate from the year the gain occurred.
Key Takeaways
- Capital gains tax is owed only when you sell an investment at a profit, not while you hold it.
- The tax year for the gain is the calendar year in which the sale closes, regardless of when you file your return.
- Long-term gains (held over one year) are taxed at lower rates than short-term gains (held one year or less).
- You report the sale on Schedule D of your tax return, and the IRS uses your cost basis (what you paid) to calculate the gain.
How the IRS knows about your sale
Your broker sends you a Form 1099-B after the year ends, listing every sale you made and the proceeds. The IRS gets a copy too. This form shows the sale date, the number of shares, and the total amount you received — but it usually does not show your original cost basis, which is your responsibility to track.
You then report the sale on Schedule D (Capital Gains and Losses), which is part of your Form 1040. You list the date you bought, the date you sold, what you paid, what you received, and the gain or loss. The IRS matches this against the 1099-B your broker reported, so the numbers need to line up.
The difference between long-term and short-term holding periods
If you hold an investment for more than one year before selling, the gain is long-term. Long-term capital gains are taxed at preferential rates: 0%, 15%, or 20%, depending on your income. These rates are much lower than ordinary income tax rates.
If you hold for one year or less, the gain is short-term. Short-term gains are taxed as ordinary income — at your regular tax bracket, which could be 10%, 12%, 22%, 24%, 32%, 35%, or 37%. The holding period clock starts the day after you buy and ends on the day you sell.
This is why the date you bought matters as much as the date you sold. A stock bought on June 15, 2023, and sold on June 15, 2024, is exactly one year and qualifies as long-term. Sell it on June 14, 2024, and it is short-term.
What happens if you sell at a loss
A loss still gets reported on Schedule D in the year you sell, but you do not owe tax on it — instead, you can use it to offset gains. If you sold three stocks and two were winners and one was a loser, you subtract the loss from the gains and only pay tax on the net amount.
If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against other income (like wages or interest). Any loss beyond that carries forward to future years, so you can use it later when you have gains again.
Inherited investments and the step-up in basis
If you inherit an investment, the tax clock resets. Your cost basis becomes the value on the date the person died, not what they originally paid. This is called a step-up in basis. If your parent bought a stock for $10 and it was worth $100 when they died, your basis is $100. If you sell it the next day for $105, you owe tax on only $5 of gain.
This applies whether you hold the inherited investment for one day or ten years — the step-up happens at death, not at sale. The year you sell the inherited investment is still the year you owe tax, but the gain is usually much smaller because of the stepped-up basis.
Mutual funds and dividend reinvestment complicate the picture
If you own a mutual fund and reinvest the dividends, each reinvestment is a separate purchase at a separate price. When you sell the fund, you need to know the cost basis of each lot you bought. Some investors track this manually; others use their broker's records or choose a method like "first in, first out" (FIFO) or "average cost" to simplify the calculation.
The year you owe tax on the gain is still the year you sell the fund, but calculating the gain requires knowing how much you paid for all the shares, including those bought with reinvested dividends. Your broker can usually help you figure this out, and many platforms now track it automatically.
Wash sales and the 30-day rule
If you sell an investment at a loss and then buy the same or a substantially identical investment within 30 days before or after the sale, the IRS treats it as a wash sale. You cannot deduct the loss in the year you sold it. Instead, the loss is added to the cost basis of the new investment you bought.
This rule exists to prevent people from selling losers to claim a tax deduction and then when ready buying them back. The 30-day window runs from 30 days before the sale through 30 days after, so you need to wait 31 days to buy back the same security if you want to claim the loss in that tax year.
Frequently Asked Questions
Do I owe capital gains tax if I sell at a loss?
No, you do not owe tax on a loss. Instead, you can use the loss to reduce any capital gains you had that year. If losses exceed gains, you can deduct up to $3,000 against other income, and carry the rest forward to future years.
What if I sell an investment in December but do not receive the money until January?
The year you owe tax is the year the sale settles, not the year you receive the cash. Most stock sales settle within two business days, so a December sale usually settles in December even if you see the money in early January. Check your trade confirmation for the settlement date.
Can I avoid capital gains tax by holding an investment forever?
Yes — as long as you never sell, you never owe capital gains tax on the growth. The tax is only triggered when you sell. However, if you pass the investment to heirs, they receive a stepped-up basis and can sell without owing tax on the growth that happened during your lifetime.
Do I owe capital gains tax on investments in a 401(k) or IRA?
No. Investments inside a 401(k) or traditional IRA grow tax-free, and you do not owe capital gains tax when you sell them inside the account. You owe income tax when you withdraw the money in retirement. Roth IRAs are even better — withdrawals in retirement are tax-free.
What if I cannot find my original purchase receipt?
Your broker should have a record of the purchase in your account history or statements. If you have lost those records, you can request them from the broker or use your tax returns from prior years. If you truly cannot find the cost basis, the IRS may require you to assume a basis of zero, meaning the entire sale price is taxable gain.
This guide is for general information only and is not medical, financial, legal, or other professional advice. For decisions specific to your situation, consult a qualified professional. See our Editorial Policy.