Last updated: October 17, 2026
- How capital gains work
- Short-term vs long-term capital gains
- Capital gains example
- Ways investors manage capital gains
- Cost basis and holding period details
- FAQ
- Related terms
How capital gains work
A capital gain equals the sale proceeds minus the cost basis, which is generally what you paid including commissions. While you still hold the position, any increase is an unrealized gain and is not taxed. The gain becomes realized when you sell. If you sell for less than your basis, you have a capital loss.
Gains can come from any capital asset: shares, ETFs, bonds, real estate or precious metals. Separately, a dividend is income rather than a capital gain, although funds may distribute capital gains to shareholders.
Short-term vs long-term capital gains
Under US federal rules, a holding period of one year or less produces a short-term gain, taxed at ordinary income rates. Holding for more than one year produces a long-term gain, taxed at preferential rates. The IRS sets the rate thresholds and adjusts them periodically, so check current figures. Frequent strategies such as day trading generate almost entirely short-term gains.
Capital gains example
Suppose you buy 100 shares at $50, for a basis of $5,000. Eighteen months later you sell at $65, receiving $6,500. Your realized long-term capital gain is $1,500. If you had sold after eight months instead, the same $1,500 would be a short-term gain.
Now suppose you also sold another stock at a $600 loss in the same year. Capital losses offset capital gains, so your net gain would be $900. Net losses beyond your gains can offset a limited amount of ordinary income, with the remainder carried forward.
Ways investors manage capital gains
- Hold longer to qualify for long-term treatment.
- Tax-loss harvesting: realize losses to offset gains, keeping wash-sale rules in mind.
- Use tax-advantaged accounts such as a Roth IRA or traditional IRA, where trades do not trigger current capital gains tax.
- Track your basis for each lot, especially after reinvested dividends.
Tax rules are complex and change; this page is educational, not tax advice.
Cost basis and holding period details
If you bought shares in several lots at different prices, the lot you sell determines your gain. Brokers commonly default to first-in, first-out, but many let you select specific lots, which can change both the size and the short- or long-term character of the gain. The holding period generally begins the day after purchase and includes the day of sale. Reinvested dividends create new lots with their own basis and dates. Corporate actions such as stock splits adjust the per-share basis without changing the total, and inherited or gifted shares follow special basis rules. Keeping accurate records makes year-end reporting far easier and helps avoid paying tax twice on the same money.
Frequently asked questions
How long do I need to hold a stock to get long-term capital gains?
Under US rules, you must hold it for more than one year. A holding period of one year or less produces a short-term gain.
Do I pay capital gains tax if I do not sell?
No. Unrealized gains are generally not taxed. Tax is typically due only when you sell and realize the gain in a taxable account.
Can capital losses offset capital gains?
Yes. Realized capital losses offset realized gains, and excess losses can offset a limited amount of ordinary income each year with the rest carried forward.
Related terms
← Candlestick Charts · All terms A–Z · Capitalization →
For information only, not investment advice. See the disclaimer.