Capital Gains Basics

A capital gain is the profit when you sell an investment for more than you paid. Here is how gains and losses are calculated, when they are taxed and how losses can offset gains. General education, not tax advice.

Gains happen when you sell

Your capital gain or loss is the sale price minus your cost basis, which is generally what you paid, including commissions. In the U.S., gains are generally taxed only when you sell, called realizing the gain. A stock that has risen but that you still hold has an unrealized gain and is generally not taxed yet.

A simple example

ItemAmount
Bought 100 shares at $50$5,000 cost basis
Sold 100 shares at $80$8,000 proceeds
Capital gain$3,000
If sold at $30 instead$2,000 capital loss

Hypothetical example; commissions ignored.

Losses offset gains

Capital losses first offset capital gains. If losses exceed gains, you can generally deduct up to $3,000 a year against ordinary income ($1,500 if married filing separately) and carry the rest forward to future years. Selling losers to offset gains is called tax-loss harvesting.

Where you hold investments changes how they are taxed.

Where gains are not taxed yearly

Key takeaways

Review unrealized gains and losses in Portfolio Analytics