FreeCalculators

Capital Gains Tax Calculator — Advanced

Calculate your capital gains tax on stocks and investments. Compare short-term and long-term rates for effective tax planning.

Business & Tax · Reviewed by FreeCalculators Editorial · Updated 2026-09-01

How it works

The Capital Gains Tax Calculator — Advanced allows you to determine the tax implications of selling your stocks or investments based on their purchase and sale prices. It distinguishes between short-term and long-term capital gains, which are taxed at different rates. The formula for calculating taxes is straightforward: for short-term gains, use the ordinary tax rate, while for long-term gains, apply the long-term capital gains (LTCG) rate plus any applicable Net Investment Income Tax (NIIT). For example, if you purchased stocks for $50,000 and sold them for $75,000, your capital gain would be $25,000. If you held the investment for 18 months, it qualifies as long-term. Thus, the long-term tax would be calculated as $25,000 multiplied by the LTCG rate of 15%, resulting in $3,750 in taxes. In contrast, had you held the investment for less than a year, the short-term tax would be $25,000 multiplied by the ordinary rate of 22%, leading to a tax of $5,500. This calculator helps you visualize the financial benefits of long-term investing versus short-term trading.

Formula


                Short-term tax = Gain × Ordinary rate. Long-term tax = Gain × LTCG rate + NIIT.
              

Tips

  • Always consider your holding period before selling; holding for over a year can significantly reduce your tax burden.
  • Utilize tax-loss harvesting strategies to offset capital gains with losses from other investments.
  • Keep track of your investment costs, including fees and commissions, as they can reduce your overall gain.
  • Review your tax situation annually to adjust your investment strategy based on changing tax laws and personal income.

Frequently asked questions

What is the difference between short-term and long-term capital gains?
Short-term capital gains apply to assets held for one year or less and are taxed at your ordinary income tax rate. Long-term capital gains apply to assets held for more than one year and are taxed at reduced rates, typically 0%, 15%, or 20% depending on your income.
How is the capital gain calculated?
Capital gain is calculated by subtracting the purchase price from the sale price. For example, if you bought an asset for $50,000 and sold it for $75,000, your capital gain would be $25,000.
What is the Net Investment Income Tax (NIIT)?
The NIIT is an additional 3.8% tax applied to individuals with a modified adjusted gross income over $200,000 ($250,000 for married couples filing jointly) on certain investment income, including capital gains.
Can I offset capital gains with capital losses?
Yes, you can offset capital gains with capital losses to reduce your taxable income. If your losses exceed your gains, you can use up to $3,000 of the excess loss to offset other income, with any remaining losses carried forward to future years.