When you sell an investment or a piece of property for more than you paid for it, the profit is called a capital gain, and it may be taxed. This is capital gains tax, and it affects anyone who sells stocks, funds, real estate, or other assets at a profit. Yet many people only discover it when they receive a tax bill they did not expect.
The rules are not as complicated as they first seem. The tax depends mainly on how long you held the asset, how much profit you made, and your overall income. Understanding the basics can help you plan sales more wisely and avoid unpleasant surprises at tax time.

What Is a Capital Gain?
A capital gain is the profit you make when you sell an asset for more than its cost basis, which is generally what you paid for it, plus certain costs such as purchase fees or improvements. If you buy shares for one amount and later sell them for more, the difference is your gain. If you sell for less, you have a capital loss instead.
Capital gains tax only applies when you actually sell. While your investments rise in value on paper, you do not owe tax on those unrealised gains. The tax event happens at the moment of sale.
Short-Term vs Long-Term Gains
The tax system treats gains differently depending on how long you held the asset. A short-term gain comes from an asset you held for a year or less, while a long-term gain comes from an asset you held for more than a year. This distinction matters because the two are taxed at different rates.
Short-term gains are generally taxed at the same rates as ordinary income, such as wages, which can be relatively high. Long-term gains are generally taxed at lower, preferential rates that depend on your income level. Because of this difference, holding an investment for just over a year rather than just under it can meaningfully reduce the tax you owe, though it should never be the only reason to hold or sell.
How the Tax Is Calculated
To work out a capital gain, you start with the sale price and subtract your cost basis and any selling costs. The result is your gain. Your tax rate then depends on whether the gain is short-term or long-term, and on your taxable income for the year.
For long-term gains, the tax rates are set in bands that vary with income, and some taxpayers with lower incomes may pay no tax on long-term gains at all. For short-term gains, the ordinary income tax brackets apply. The exact rates and income thresholds change over time with tax law.
Capital Gains on Your Home
Selling your primary home has its own rules, and they can be generous. In many cases, homeowners who have lived in their home for a certain number of years may be able to exclude a large amount of gain from tax, up to a limit that depends on their filing status. This exclusion applies to the gain on a primary residence, not to investment properties or second homes.
If your gain is larger than the exclusion, the excess may be taxed as a capital gain. Keeping good records of the purchase price and the cost of major improvements matters here, because those costs increase your basis and reduce your taxable gain.
Offsetting Gains With Losses
If you have both gains and losses in the same year, the tax system lets you offset them against each other. This is sometimes called tax-loss harvesting. Losses can first cancel out gains of the same type, and any remaining losses can offset gains of the other type, within the rules.
If your losses are larger than your gains, you may be able to deduct a limited amount of the net loss against your other income in that year, and carry the rest forward to future years.
Ways to Reduce Your Capital Gains Tax
The simplest way to reduce capital gains tax is to hold investments for more than a year when it makes sense, so your gains qualify for the lower long-term rates. Another approach is to sell losing investments in the same year as winning ones, so the losses offset the gains.
Using tax-advantaged accounts can also help. Gains inside retirement accounts such as IRAs and 401(k)s are generally not taxed year by year, and the tax is handled under the rules of the account instead. Donating appreciated investments to charity can be another option, because it may let you avoid the capital gains tax while also giving you a deduction, subject to the rules that apply.
Frequently Asked Questions
Do I pay capital gains tax if I do not sell?
No. Tax is generally only due when you sell an asset and realise a gain. Increases in value that stay on paper are not taxed in the year they happen.
How long do I need to hold an asset for long-term treatment?
Generally more than one year. Assets held for a year or less produce short-term gains, while assets held for more than a year produce long-term gains.
Are capital gains taxed differently from wages?
Yes, usually. Short-term gains are generally taxed like ordinary income, while long-term gains are generally taxed at lower preferential rates that depend on your income.
Can I avoid capital gains tax by reinvesting the money?
In most cases, no. Reinvesting the proceeds of a sale does not erase the gain, although special rules apply to certain situations, such as selling a primary home or using specific exchange rules for investment property.
What records should I keep for capital gains?
Keep records of what you paid, when you bought and sold, any fees, and the cost of improvements for property. These records determine your cost basis and therefore how much gain you report.
Related guides: 2026 Federal Tax Brackets Explained in Plain English, Tax Refund Planning 2026 Smart Ways to Use Your Refund, Tax-Loss Harvesting Basics for Everyday Investors