What Is Capital Gains Tax?

Capital gains tax is the tax you owe on the profit when you sell an asset — such as a stock, a fund, or real estate — for more than you paid for it. The key word is profit: you are taxed on the gain, not on the full sale price, and only when you actually sell.

Realized vs. Unrealized Gains

An asset that has risen in value but that you still own has only an unrealized gain — a paper profit that is not taxed. The gain becomes realized, and potentially taxable, only when you sell. This is why long-term investors can let an investment grow for years without triggering a tax bill until they choose to sell.

Short-Term vs. Long-Term Gains

How long you hold an asset before selling usually matters more than any other factor. The holding period splits gains into two categories that are taxed very differently:

  • Short-term — assets held for one year or less. These gains are generally taxed at your ordinary income tax rate, the same as your wages.
  • Long-term — assets held for more than one year. These gains qualify for preferential rates that are typically lower than ordinary income rates and depend on your taxable income.

Exact rates and income thresholds are set by the IRS and adjust most years, so always check the current figures rather than relying on a fixed number. The practical takeaway is durable: holding an investment past the one-year mark can meaningfully lower the tax on the same gain.

How the Gain Is Calculated

A capital gain is the sale price minus your cost basis — generally what you originally paid, plus reinvested dividends, commissions, and (for property) the cost of improvements. A higher basis means a smaller taxable gain, so keeping good records of what you invested matters. To put real numbers to a scenario, our investment return calculator helps you see how an asset grew, and the tax estimator helps you frame the income side of the picture.

Capital Losses Can Offset Gains

Investments do not always go up, and the tax code accounts for that. When you sell an asset for less than its basis, the capital loss can be used to offset capital gains in the same year. If your losses exceed your gains, you can generally use a limited amount to offset ordinary income and carry the rest forward to future years. Deliberately realizing losses to offset gains is a common year-end strategy known as tax-loss harvesting.

Common Ways to Reduce Capital Gains Tax

Several legitimate strategies can lower or defer the tax, though the right mix depends entirely on your situation:

  • Hold for the long term to qualify for the lower long-term rates.
  • Use tax-advantaged accounts — gains inside accounts like a 401(k) or IRA are not taxed each time you trade, which is one reason index funds pair well with them; see our explainer on what an index fund is.
  • Harvest losses to offset gains in the same tax year.
  • Mind the primary-residence exclusion, which can shelter a portion of the gain on a home you have lived in, subject to IRS rules.

Capital gains tax rules are detailed and change over time, and this article is general education rather than personalized tax advice. For a decision that materially affects your taxes, confirm the current rules or speak with a qualified tax professional.

Frequently Asked Questions

Only when you sell an asset for a profit (a realized gain). Simply holding an investment that has gone up in value does not trigger the tax; the gain is unrealized until you sell.

Short-term gains are on assets held one year or less and are taxed at your ordinary income rate. Long-term gains are on assets held more than a year and qualify for preferential rates that are usually lower and depend on your income.

A gain equals the sale price minus your cost basis. Cost basis is generally what you paid plus items like commissions, reinvested dividends, and (for property) improvements, so a higher basis reduces the taxable gain.

Yes. Capital losses offset capital gains in the same year, and if losses exceed gains you can generally offset a limited amount of ordinary income and carry the remainder forward to future years.

Common approaches include holding assets longer than a year for the lower long-term rate, investing through tax-advantaged accounts, harvesting losses to offset gains, and using the primary-residence exclusion on a qualifying home sale. Rules vary, so confirm current details.