What counts as a capital gain and when you owe tax on it

A capital gain is the profit you make when you sell an investment or property for more than you paid for it. If you bought stock for $5,000 and sold it for $8,000, your capital gain is $3,000. The IRS taxes that profit, but the amount you owe depends on how long you held the asset and your income level.

The IRS splits capital gains into two categories: short-term (held one year or less) and long-term (held more than one year). Short-term gains are taxed as ordinary income, which means they use your regular tax bracket — potentially 10%, 12%, 22%, 24%, 32%, 35%, or 37%. Long-term gains get preferential rates: 0%, 15%, or 20%, depending on your income. This difference is the foundation of most tax-reduction strategies.

You do not owe tax on a gain until you actually sell the asset. Holding an investment that has grown in value costs you nothing in taxes, no matter how many years pass. This matters because it means timing your sale can change your tax bill significantly.

Key Takeaways

  • Holding an investment for more than one year before selling qualifies it for long-term capital gains rates, which are substantially lower than short-term rates for most taxpayers.
  • You can offset capital gains dollar-for-dollar by selling investments at a loss in the same year, a strategy called tax-loss harvesting.
  • Donating appreciated assets directly to charity avoids the capital gains tax entirely while giving you a charitable deduction.
  • Stepping up your cost basis through inheritance means heirs pay tax only on gains that occur after they inherit, not on the appreciation that happened before.
  • Holding assets until death eliminates capital gains tax on all appreciation that occurred during your lifetime.

Hold investments longer than one year to use long-term rates

The simplest way to reduce capital gains tax is to wait. If you sell an investment within one year of buying it, the gain is taxed as short-term income. If you wait more than one year, it becomes long-term and gets the lower rate.

The difference is substantial. Suppose you have a $10,000 gain and your ordinary tax bracket is 24%. Short-term tax would be $2,400. Long-term tax on the same gain is either $0 (if your income is low enough), $1,500 (15% rate), or $2,000 (20% rate). For most middle-income taxpayers, long-term means paying 15% instead of 24% — a savings of $900 on that $10,000 gain.

This strategy works only if you can afford to wait. If you need the money sooner, or if the investment is falling in value, holding longer may not make sense. But if you are considering selling a winner and have no when ready need for the cash, waiting past the one-year mark is often worth the delay.

Sell losing investments to offset gains from winners

Tax-loss harvesting means selling an investment at a loss to cancel out capital gains from other sales. If you sold stock A for a $5,000 gain and own stock B that has dropped $3,000 below what you paid, selling stock B creates a $3,000 loss that reduces your taxable gain to $2,000.

You can harvest losses throughout the year, not just at year-end. Many investors review their portfolio in November or December specifically to identify losses they can use before the tax year closes. The loss must be realized — meaning you actually sold it — to count. An investment that is underwater but still in your account does not help.

If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess against your ordinary income. Any losses beyond that carry forward to future years, so they are not wasted. This means a year with large losses can shelter gains for multiple years to come.

One rule to watch: the wash-sale rule prevents you from selling a stock at a loss and buying the same or substantially identical stock within 30 days before or after the sale. If you do, the loss does not count. You can buy a similar but different stock when ready — for example, selling one S&P 500 index fund and buying another — but not the exact same one.

Donate appreciated assets directly to charity instead of selling them

If you own stock, real estate, or other investments that have gained value and you want to give to charity, donating the asset itself avoids capital gains tax entirely. You get a charitable deduction for the full current value, and the charity receives the asset tax-free.

Example: You bought stock for $10,000 that is now worth $25,000. If you sell it, you owe tax on the $15,000 gain. If you donate it to a may have access to charity instead, you deduct $25,000 as a charitable contribution and pay zero capital gains tax. The charity can sell it without owing tax because charities are tax-exempt.

This works for any appreciated asset: stocks, mutual funds, real estate, art, or collectibles. The asset must go to a may have access to charity — the IRS website has a searchable database. You will need a written appraisal for non-cash donations over $5,000, and you must itemize deductions on your tax return to claim the deduction (which means your total deductions must exceed the standard deduction).

Use the step-up in basis when you inherit assets

When you inherit an investment or property, its cost basis — the value used to calculate your gain when you eventually sell it — resets to its value on the date of death. This is called a step-up in basis.

If your parent bought stock for $50,000 and it was worth $200,000 when they died, your cost basis becomes $200,000. If you sell it a month later for $205,000, your taxable gain is only $5,000, not $150,000. The $150,000 appreciation that happened during your parent's lifetime is never taxed.

This is one of the largest tax breaks available, and it applies automatically — you do not have to do anything to claim it. It applies to real estate, stocks, bonds, and most other assets. The step-up happens whether or not the estate owes federal estate tax.

The strategy implication is that for very wealthy people with large unrealized gains, holding assets until death can eliminate a substantial tax bill. This is not a reason to avoid selling during life if you need the money or want to rebalance your portfolio, but it is worth understanding when you are making the decision.

Hold assets in tax-advantaged accounts to defer or eliminate gains

Money inside a 401(k), IRA, or Roth IRA grows without triggering capital gains tax each year. You can buy and sell investments within these accounts as often as you want, and no tax is due until you withdraw the money (or never, in the case of a Roth).

This is not a strategy you choose — it is automatic if you have these accounts — but it is worth maximizing. The IRS sets annual contribution limits: $23,500 for a 401(k) in 2024, $7,000 for a traditional or Roth IRA. If you have access to a 401(k) through your employer, using it shields a large portion of your investment gains from annual taxation.

A Roth IRA is particularly powerful because withdrawals in retirement are tax-free, including all gains. If you can afford to contribute to a Roth, the long-term tax savings can be substantial. Contribution limits are lower than 401(k)s, and income limits explore, but the benefit is real.

Spread large sales across multiple tax years if possible

If you are selling a business, real estate, or large investment portfolio, you may be able to structure the sale to receive payments over multiple years rather than a lump sum. This can keep your income in a lower tax bracket in each year, reducing the rate applied to your gains.

Example: Selling a rental property for a $100,000 gain in one year might push you into the 20% long-term capital gains bracket. If you can structure the sale as an installment agreement and receive $50,000 of the gain in year one and $50,000 in year two, you might stay in the 15% bracket both years, saving money overall.

This requires negotiating the sale structure with the buyer, which is not always possible. It works best for real estate or business sales where the buyer is willing to pay over time. For stock or mutual fund sales, you straightforward sell when you sell — there is no way to spread the proceeds.

Frequently Asked Questions

Do I owe capital gains tax if I sell at a loss?

No. A loss means you sold for less than you paid, so there is no gain to tax. You can use the loss to offset other gains or, if losses exceed gains, deduct up to $3,000 against ordinary income in that year. Excess losses carry forward to future years.

What if I inherited stock and it went up after I inherited it — do I owe tax on that gain?

Yes, but only on the gain after inheritance. Your cost basis steps up to the value on the date of death, so you owe tax only on appreciation from that point forward. If the stock was worth $100,000 when you inherited it and you sell it for $110,000, your taxable gain is $10,000.

Can I avoid capital gains tax by not selling?

Yes, as long as you hold the asset. Tax is due only when you sell or otherwise dispose of it. If you need the money, you might borrow against the asset instead, though this creates debt. If you hold until death, your heirs get the step-up and the tax is avoided entirely.

Does the long-term capital gains rate explore to real estate?

Yes, if you held the property more than one year. However, real estate has additional rules. If you sell a primary residence, you can exclude up to $250,000 of gain ($500,000 if married filing jointly) from tax entirely, regardless of how long you held it. Investment properties do not get this exclusion.

What is the difference between a traditional IRA and a Roth IRA for capital gains?

Both avoid annual capital gains tax on investments inside the account. With a traditional IRA, you pay tax on withdrawals in retirement. With a Roth, withdrawals are tax-free. A Roth is better for capital gains if you expect large gains, because those gains are never taxed. Contribution limits and income restrictions explore to both.