Do You Owe Taxes When You Sell Stock? Capital Gains, Explained

A calendar page marking a one-year line, with a coin stack taking a large bite before the line and a smaller bite after it, illustrating how the holding period changes the capital gains tax rate

I’ve written a dozen posts assuming you’ll eventually sell something you bought — an index fund, a stock, whatever — without ever explaining what happens tax-wise when you do. Selling an investment for more than you paid for it is a taxable event, and the tax you owe depends heavily on one date most people aren’t tracking: how long you held it.

The one-sentence version

A capital gain is the profit from selling an investment for more than you paid, and it’s taxed at a much lower rate if you held it for more than a year than if you sold it sooner — the exact same profit, taxed at two very different rates, based entirely on that one date.

Short-term vs. long-term, and why the line matters so much

Short-term capital gains — from something you held for one year or less — are taxed as ordinary income, at the same rate as your paycheck. Long-term capital gains — from something held for more than a year — get their own, meaningfully lower tax rates.

Here’s what that gap actually looks like on a $1,000 profit, using representative rates (your actual bracket depends on your income and the current tax year — this is the mechanism, not a personal number):

  Tax rate (illustrative) Tax owed on $1,000 gain
Sold after 11 months (short-term) 24% $240
Sold after 13 months (long-term) 15% $150

Same investment, same $1,000 profit, same two extra months of waiting — $90 less tax, 60% less than the short-term bill, purely for crossing the one-year mark before selling. That’s the single most important fact in this entire post: the calendar, not the market, is sometimes the biggest lever on what you actually keep.

What actually counts as a gain

You only owe tax when you sell (or otherwise dispose of) the investment — an index fund or stock sitting in your account, going up in value on paper, owes nothing. This is called an “unrealized” gain, and it isn’t taxed until you realize it by selling. Buy a stock for $2,000, watch it grow to $5,000, and you owe nothing as long as you keep holding it — the $3,000 gain only becomes taxable the moment you sell.

This is also why “I don’t want to sell because of the taxes” is sometimes a real, rational reason to keep holding something, separate from any opinion about where the price is headed next.

Dividends get taxed too — even if you don’t sell anything

If you own a dividend-paying stock or fund, the dividends themselves are taxable income in the year you receive them, whether or not you sell anything and whether or not you reinvest them automatically. “Qualified” dividends (most dividends from stock held long enough) get the same lower long-term rates; “ordinary” (non-qualified) dividends are taxed like short-term gains, at your regular income tax rate. Reinvesting a dividend into more shares doesn’t make it tax-free — it just means you’re using after-tax money to buy more of the investment.

Losses aren’t just bad news, tax-wise

If you sell an investment for less than you paid, that’s a capital loss, and it isn’t purely a loss on the tax side: losses offset gains. Sell one stock for a $1,500 gain and another for a $1,000 loss in the same year, and you’re only taxed on the net $500. If your losses exceed your gains for the year, you can typically deduct a limited amount (commonly up to $3,000) against ordinary income, with any excess carried forward to future years. This is the basic idea behind “tax-loss harvesting” — deliberately selling a losing position to offset a gain elsewhere, which only makes sense as a side effect of an investment decision you’d make anyway, not a reason to invent one.

One rule worth knowing here: the wash sale rule disallows the loss if you buy the same or a “substantially identical” investment within 30 days before or after the sale — you can’t sell a stock at a loss for the tax deduction and immediately buy it right back.

Why this doesn’t apply inside a Roth or Traditional IRA

Everything above is specific to a regular (“taxable”) brokerage account. Inside a Roth or Traditional IRA, you can buy and sell investments freely without triggering capital gains tax on each transaction — the tax treatment is handled entirely at contribution and withdrawal instead, which is a big part of why these accounts exist. This is also a real, practical reason people hold their most frequently-traded or highest-growth investments inside a retirement account when they have the choice, and save the taxable account for things they’re likely to hold for years without much buying and selling.

Why this quietly favors buy-and-hold

Frequent trading doesn’t just add trading costs and the risk of bad timing — it also resets your holding-period clock on every single trade, which means active trading tends to generate short-term gains taxed at the higher, ordinary-income rate, while a buy-and-hold approach to a broad index fund naturally produces long-term gains when it eventually gets sold. The tax code isn’t neutral on this — it’s structurally built to reward holding an investment for longer, on top of everything else that already favors not trading in and out of positions.

The takeaway

A gain isn’t taxed until you sell, and once you do, the single biggest lever on the bill — bigger than picking the “right” moment to sell — is often whether you crossed the one-year mark first. Before selling something that’s up meaningfully, it’s worth checking your purchase date against today’s date; a few weeks of patience can be the difference between the short-term rate and the long-term one, on money you were going to sell anyway.

Discussion