You don't pay capital gains tax when you sell — you pay it when you file your tax return

The moment you sell an investment at a profit, you owe the tax on that gain, but the IRS does not demand payment when ready. Instead, the tax liability sits until you file your annual return, usually due April 15 of the following year. If you sell stock in March 2024, you report that gain on your 2024 tax return filed in April 2025, and that is when payment is due.

This timing matters because it gives you months to prepare. You are not writing a check to the IRS the day after you sell. But it also means the liability exists whether you pay attention to it or not — ignoring it does not make it go away, and waiting until April to realize you owe a large amount can create cash flow problems.

Key Takeaways

  • Capital gains tax is owed in the year you sell the investment, but payment is not due until you file your tax return the following spring.
  • If you expect to owe more than $1,000 in federal income tax and capital gains combined, you may need to make quarterly estimated tax payments starting in April of the current year.
  • Long-term capital gains (assets held over one year) are taxed at lower rates than short-term gains, so the timing of your sale affects how much you owe.
  • Selling an investment in a taxable brokerage account triggers the tax, but selling inside a 401(k) or IRA does not, because those accounts defer or eliminate capital gains tax entirely.

How the tax year and filing important date create the payment timeline

The U.S. tax year runs January 1 through December 31. Any capital gain you realize during that calendar year — whether you sell in January or December — belongs to that year's tax return. If you sell 100 shares of a stock for a $5,000 gain in June 2024, that $5,000 gain is reported on your 2024 Form 1040, filed in 2025.

The IRS important date to file and pay is April 15 of the following year, though you can request an extension to October 15 if you need more time. The extension delays filing, not payment — if you owe tax, the IRS expects payment by April 15 even if you file late. Unpaid tax after April 15 accrues interest and penalties.

This means you have roughly three to four months from the end of the tax year to gather your documents, calculate your gain, and prepare payment. For someone who sells in December, that window is tight. For someone who sells in January, it is much longer.

Quarterly estimated tax payments if you expect a large gain

If you know you will owe more than $1,000 in total federal income tax and capital gains tax combined, the IRS expects you to pay in installments throughout the year, not all at once in April. These are called estimated tax payments, and they are due on specific dates: April 15, June 15, September 15, and January 15 of the following year.

This rule applies mainly to self-employed people and investors with significant income outside of payroll withholding. If you work a W-2 job and your employer withholds taxes from each paycheck, you may not need to make estimated payments even if you have a large capital gain — your withholding might cover it. But if you are retired, freelance, or have substantial investment income, you likely do.

The penalty for underpaying estimated tax is small but real: the IRS charges interest on the shortfall, calculated from the due date of each missed payment. If you owe $10,000 in capital gains tax and pay nothing until April, you will owe interest on that $10,000 for the entire year. Paying quarterly reduces that interest.

Long-term versus short-term gains and how holding period affects your bill

The timing of when you sell also determines your tax rate. If you hold an investment for more than one year before selling, your gain is long-term capital gains, taxed at 0%, 15%, or 20% depending on your income. If you sell within one year, it is short-term capital gains, taxed as ordinary income at rates up to 37%.

This difference is enormous. A $10,000 short-term gain could cost you $3,700 in federal tax if you are in the top bracket. The same $10,000 long-term gain costs $2,000. Holding for one year and one day instead of 364 days can cut your tax bill in half.

The holding period clock starts the day after you buy. If you purchase stock on January 15, 2024, you hit the one-year mark on January 15, 2025. Selling on January 16, 2025 qualifies for long-term rates; selling on January 15 does not. Your brokerage statement shows the purchase date, so you can verify this before you sell.

Tax-deferred accounts where you never pay capital gains tax on the sale itself

If you own investments inside a 401(k), traditional IRA, or Roth IRA, you can buy and sell within that account without triggering capital gains tax. You can sell a stock at a $50,000 profit inside your IRA and owe nothing at that moment. The tax treatment depends on the account type, not on the sale.

In a traditional 401(k) or IRA, you pay tax when you withdraw money in retirement, and the entire withdrawal is taxed as ordinary income — the account does not track which portion came from gains versus contributions. In a Roth IRA, may have access to withdrawals are tax-free entirely, so the gain is never taxed. This is why tax-advantaged accounts are so valuable for frequent traders: they eliminate the capital gains tax on every transaction inside the account.

The catch is contribution limits. You can put only $7,000 per year into an IRA (or $8,000 if you are 50 or older) and $23,500 into a 401(k) in 2024. Once you max out, any additional investments go into a taxable brokerage account, where capital gains tax applies.

What happens if you cannot pay by April 15

If you file your return on time but cannot pay the full amount owed, you can request a payment plan from the IRS. Short-term plans (120 days or less) have no setup fee. Long-term plans (more than 120 days) charge a fee, currently $31 to $225 depending on the method you use. Interest accrues on the unpaid balance at the federal rate plus 3% per year.

Filing on time even if you cannot pay is important: the failure-to-file penalty is much steeper than the failure-to-pay penalty. If you file late, the penalty is 5% of unpaid tax per month (up to 25%). If you file on time but pay late, it is 0.5% per month. The difference is substantial.

You can also request an extension to file (Form 4868), which gives you until October 15, but this does not extend the payment important date. The IRS still expects payment by April 15, and interest runs from that date if you do not pay.

State capital gains taxes and how they add to your federal bill

Nine states have no capital gains tax: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming, and New Hampshire (which taxes only dividends and interest, not gains). The other 41 states and Washington, D.C. tax capital gains, usually as ordinary income at their regular income tax rates.

California, for example, taxes long-term capital gains at the same rate as wages — up to 13.3% — so a $10,000 long-term gain in California costs you 15% federal plus 13.3% state, totaling $2,830. The same gain in Texas costs only 15% federal, or $1,500. State tax is due on the same April 15 important date as federal tax.

If you move to a different state after selling an investment, the state where you lived when you sold is the one that taxes the gain. Moving to Florida after a sale does not erase the tax owed to your previous state.

Frequently Asked Questions

Do I owe capital gains tax the moment I sell, or only when I file my return?

You owe the tax in the year you sell, but payment is not due until you file your return in April of the following year. The liability exists when ready, but the IRS does not demand payment until then. If you sell in December, you have until April 15 to pay.

What if I sell an investment and when ready reinvest the money — do I still owe capital gains tax?

Yes. Reinvesting does not erase the tax. If you sell a stock for a $5,000 gain and buy a different stock with that money, you still owe tax on the $5,000 gain. The tax is based on the sale, not on what you do with the proceeds.

Can I avoid capital gains tax by holding the investment until I die?

Yes, in a sense. When you die, your heirs inherit the investment at its value on the date of your death, not at your original purchase price. This is called a "step-up in basis." If you bought stock for $10,000 and it is worth $50,000 when you die, your heirs can sell it when ready for $50,000 with no capital gains tax. However, very large estates may owe federal estate tax, which is a separate issue.

If I have a capital loss, do I still have to file a return?

Not necessarily, but you should. If you sold an investment at a loss, you can use that loss to offset gains from other sales, reducing your tax bill. You can also carry unused losses forward to future years. Filing lets you claim these deductions even if you would not otherwise owe tax.