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?
What if I sell a stock at a loss?
Does this calculator include state taxes?
What about the Net Investment Income Tax (NIIT)?
Related Calculators
Stock Profit Calculator
Calculate your profit or loss from buying and selling stocks, including commissions and annualized return.
Use calculator →Dividend Calculator
Project your dividend income over time with adjustable yield, growth rate, and reinvestment options.
Use calculator →CAGR Calculator
Calculate the Compound Annual Growth Rate of an investment to measure performance over time.
Use calculator →