How to Calculate Capital Gains Tax

In 30 seconds

  • Step-by-step guide to calculating capital gains tax on stock sales.
  • Uses 1 calculator(s) for hands-on examples

Capital gains tax applies when you sell an investment for more than you paid. Understanding how to calculate this tax helps you make informed decisions about when to sell.

Step 1: Determine Your Cost Basis

Your cost basis is typically what you paid for the investment, including any commissions or fees.

If you received shares through dividend reinvestment, inherited them, or received them as a gift, the cost basis rules differ.

Keep records of all purchase transactions—you'll need them at tax time.

Step 2: Calculate Your Holding Period

The holding period starts the day after you purchase and ends on the day you sell.

Holding for more than one year qualifies for long-term capital gains treatment, which typically has lower tax rates.

Short-term gains (held one year or less) are usually taxed at your ordinary income rate.

Step 3: Compute the Gain or Loss

Subtract your cost basis from your sale proceeds to find your gain (or loss).

Remember to subtract any selling costs from your proceeds.

A negative number means you have a loss, which can offset other gains.

Example: Selling AAPL Stock

You bought 10 shares at $100 each, held for 18 months, and sold at $150 each.

  • 1.Cost basis: 10 × $100 = $1,000
  • 2.Sale proceeds: 10 × $150 = $1,500
  • 3.Capital gain: $1,500 - $1,000 = $500
  • 4.Holding period: 18 months = Long-term
Try this in the calculator

FAQ

What if I have multiple purchases at different prices?

You can choose FIFO (first in, first out) or specific identification to determine which shares you're selling.

How do I report capital gains?

In most countries, you report on a capital gains schedule or form. Consult the relevant tax guide for your country.

Key Terms

Tools & Resources