What is a capital gain?
A capital gain is the profit when you sell a stock (or other asset) for more than your cost basis — usually what you paid, including commissions. Sell for less and you have a capital loss. The gain is only taxed when you realize it by selling; unrealized gains on stock you still hold are never taxed, no matter how much it has risen.
Short-term vs long-term
The single biggest lever on your tax bill is your holding period. Hold a stock for one year or less and the gain is short-term, taxed at your ordinary income rate — up to 37% federally. Hold it more than one year and it becomes long-term, taxed at the preferential rates of 0%, 15% or 20%. The clock starts the day after you buy and includes the day you sell. Crossing the one-year line, even by a single day, can cut the tax on a gain roughly in half.
The 2026 long-term brackets
Long-term capital-gains rates depend on your total taxable income. A large band of taxpayers sits in the 0% bracket — meaning long-term gains can be genuinely tax-free at the federal level up to the threshold. Above that you move into 15%, and only high incomes reach 20%. On top of the base rate, high earners may owe the 3.8% Net Investment Income Tax (NIIT), and your state may tax gains as ordinary income with no long-term discount. Because the brackets stack on your other income, the same gain can be taxed at very different rates depending on the year you realize it.
Offsetting gains with losses
Capital losses are valuable. They first offset capital gains of the same type, then the other type, and if losses still remain you can deduct up to $3,000 against ordinary income each year, carrying the rest forward indefinitely. Deliberately realizing losses to offset gains is called tax-loss harvesting. Watch the wash-sale rule: if you buy the same or a substantially identical security within 30 days before or after selling at a loss, the loss is disallowed and added to the basis of the replacement shares.
Legal ways to pay less
A few reliable moves reduce capital-gains tax without any gimmicks. Hold past one year to get the long-term rate. Harvest losses to offset gains in the same year. Use the 0% bracket in low-income years to realize gains tax-free. Choose your lots: selling specific high-basis shares (rather than the default first-in-first-out) shrinks the gain. And hold appreciated stock in tax-advantaged accounts where growth is deferred or tax-free.
A quick example
You buy 100 shares at $50 ($5,000 basis) and sell at $80 ($8,000), a $3,000 gain. Sold at 11 months, it is short-term: at a 32% rate you owe about $960. Wait past a year and, in the 15% long-term bracket, you owe $450 — the same profit, roughly half the tax. That difference is why the holding period matters more than almost anything else.