CalcPad

Capital Gains Tax Calculator

Estimate your capital gains tax on stock sales based on holding period and tax bracket.

$

The price you originally paid per share.

$

The price you sold (or plan to sell) per share.

How long you held the stock before selling.

Your federal income tax bracket. This determines your capital gains rate.

How Capital Gains Tax Works

Capital gains tax is levied on the profit from selling an investment for more than you paid. The tax rate depends on two factors: how long you held the asset and your income level.

Short-term capital gains apply to assets held one year or less and are taxed at your ordinary income tax rate (10% to 37%).

Long-term capital gains apply to assets held more than one year and receive preferential rates:

  • 0% for individuals in the 10% or 12% income tax brackets
  • 15% for individuals in the 22% through 35% brackets
  • 20% for individuals in the 37% bracket

This significant tax advantage is the primary reason financial advisors recommend holding investments for at least one year before selling.

Strategies to Reduce Capital Gains Tax

Several legal strategies can help minimize your capital gains tax burden:

  • Hold for over one year: The simplest strategy. Long-term rates are significantly lower than short-term rates for most investors.
  • Tax-loss harvesting: Sell losing investments to offset gains. Up to $3,000 in net losses can be deducted from ordinary income annually, with excess carried forward.
  • Use tax-advantaged accounts: Gains in traditional IRAs, Roth IRAs, and 401(k)s are not subject to capital gains tax (Roth withdrawals are tax-free; traditional accounts are taxed as income upon withdrawal).
  • Gift appreciated stock: Gifting stock to a family member in a lower tax bracket can result in lower or zero capital gains tax when they sell.
  • Charitable donations: Donating appreciated stock to charity avoids capital gains tax entirely and provides a tax deduction.

Capital Losses and the Wash Sale Rule

Capital losses can offset capital gains dollar-for-dollar. If you have $5,000 in gains and $3,000 in losses, you only pay tax on $2,000 in net gains. If losses exceed gains, you can deduct up to $3,000 from ordinary income, with the remainder carried forward to future years.

However, the IRS wash sale rule prevents you from claiming a loss if you buy the same or "substantially identical" security within 30 days before or after the sale. This rule prevents investors from selling at a loss for the tax benefit and immediately buying back the same position.

To work around the wash sale rule, you can replace the sold security with a similar but not identical investment. For example, selling one S&P 500 ETF and buying a total stock market ETF from a different provider.

Frequently Asked Questions

Do I pay capital gains tax in a 401(k) or IRA?
No. Investments in tax-advantaged accounts like 401(k)s, traditional IRAs, and Roth IRAs are not subject to capital gains tax when you buy or sell within the account. Traditional account withdrawals are taxed as ordinary income. Roth IRA qualified withdrawals are completely tax-free.
What if I sell a stock at a loss?
Capital losses can offset capital gains. If your total losses exceed total gains, you can deduct up to $3,000 of net losses from ordinary income per year. Remaining losses carry forward to future tax years indefinitely. This makes tax-loss harvesting a valuable year-end strategy.
Does this calculator include state taxes?
No, this calculator estimates federal capital gains tax only. Many states also tax capital gains, typically at their ordinary income tax rate. Some states (like Florida, Texas, and Nevada) have no state income tax. Your total tax burden will be higher if your state taxes capital gains.
What about the Net Investment Income Tax (NIIT)?
High-income taxpayers may owe an additional 3.8% Net Investment Income Tax on capital gains if their modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). This calculator does not include the NIIT. Add 3.8% to the rate shown if you are above these thresholds.

Related Calculators