finance 2026-07-09 8 min read

Capital Gains Tax Calculator: Short-Term vs Long-Term

Calculate taxes on investment profits and learn strategies to minimize capital gains tax.

Advertisement
728×90

Introduction: The Hidden Cost of Investing

When you sell an investment for a profit, the government wants a share. That share is called the capital gains tax. But not all gains are taxed equally. The amount you pay depends on how long you held the asset before selling. If you held it for one year or less, it’s a short-term gain, taxed as ordinary income. If you held it for more than a year, it’s a long-term gain, taxed at preferential rates—0%, 15%, or 20%, depending on your income.

According to the IRS, in 2024, the long-term capital gains tax rate for single filers is 0% for taxable income up to $47,025, 15% for income from $47,026 to $518,900, and 20% for income over $518,900. Short-term gains, on the other hand, can be taxed as high as 37% if you’re in the top ordinary income bracket. The difference can be thousands of dollars on a single trade.

In this guide, we’ll show you how to calculate your capital gains tax, compare short-term vs. long-term scenarios with real numbers, and explore strategies to minimize your tax bill. Use our Investment Calculator and ROI Calculator to model your own investments.

Short-Term vs. Long-Term Capital Gains

The Holding Period Rule

The key distinction is the holding period. If you buy a stock on January 1, 2024, and sell it on December 31, 2024, you’ve held it for 364 days—short-term. If you sell on January 2, 2025, you’ve held it for more than a year—long-term. The difference in tax treatment is dramatic.

Short-term gains are added to your ordinary income and taxed at your marginal tax rate. For a single filer earning $100,000 in ordinary income, a $10,000 short-term gain is taxed at 24% (the marginal rate for that income level), resulting in $2,400 in tax. The same gain as a long-term gain would be taxed at 15% (the long-term rate for that income level), resulting in $1,500 in tax—a savings of $900.

Real Number Example: A $50,000 Gain

Let’s compare two scenarios for a single filer with $80,000 in ordinary income (after deductions) and a $50,000 investment gain.

ScenarioHolding PeriodTax RateTax Owed
Short-term11 months22% (marginal rate)$11,000
Long-term13 months15% (long-term rate)$7,500

The long-term scenario saves $3,500 in taxes. That’s a 46% reduction. If you had held the investment for just two more months, you would have saved thousands. This is why tax-aware investors often delay selling until the one-year mark.

Calculating Your Capital Gains Tax

Step-by-Step Process

To calculate your capital gains tax, follow these steps:

  1. Determine your holding period. Count the days from purchase to sale. More than 365 days = long-term.
  2. Calculate your gain. Subtract your cost basis (purchase price plus commissions) from the sale price.
  3. Identify your tax bracket. For short-term gains, use your ordinary income tax bracket. For long-term gains, use the long-term capital gains brackets based on your taxable income.
  4. Apply the rate. Multiply the gain by the applicable rate.

For example, suppose you’re a married couple filing jointly with $150,000 in taxable income (including the gain). Your long-term capital gains rate is 15%. If you sell a stock held for 14 months with a $20,000 gain, your tax is $20,000 × 15% = $3,000.

Using the Investment Calculator

Our Investment Calculator can help you project future gains and taxes. Enter your purchase price, sale price, holding period, and income level, and the calculator will estimate your tax liability.

Strategies to Minimize Capital Gains Tax

1. Hold for More Than One Year

The simplest strategy is to hold your investments for at least one year and one day. The difference between short-term and long-term rates can be as much as 20 percentage points (37% vs. 20% for high earners). If you’re tempted to sell early, consider the tax cost.

2. Tax-Loss Harvesting

If you have losing investments, sell them to realize a loss. The loss can offset your gains dollar-for-dollar. If your losses exceed your gains, you can deduct up to $3,000 of the excess against ordinary income each year, and carry forward additional losses indefinitely.

For example, if you have $10,000 in long-term gains and $8,000 in long-term losses, you only pay tax on $2,000 of gains. If your losses are $12,000, you offset all gains and deduct $2,000 from ordinary income.

3. Use Tax-Advantaged Accounts

Investing in a 401(k), IRA, or Roth IRA allows your investments to grow tax-deferred or tax-free. In a traditional IRA, you pay ordinary income tax on withdrawals, but you can trade without triggering capital gains tax. In a Roth IRA, qualified withdrawals are completely tax-free.

4. Gift Appreciated Assets

If you donate appreciated stock to a charity, you avoid paying capital gains tax and can deduct the full market value (up to 30% of your adjusted gross income). You can also gift appreciated assets to family members in lower tax brackets, who may pay 0% on long-term gains.

5. Consider the 0% Bracket

For single filers with taxable income under $47,025 (2024), long-term capital gains are taxed at 0%. If you can keep your income low in a given year—by deferring salary, for example—you can realize gains tax-free.

Real-World Case Study: $100,000 Gain

Let’s look at a high-income investor earning $500,000 in ordinary income (after deductions) who sells a stock for a $100,000 gain.

  • Short-term: The gain is added to ordinary income, pushing the marginal rate to 37%. Tax = $100,000 × 37% = $37,000.
  • Long-term: The gain is taxed at 20% (the top long-term rate). Tax = $100,000 × 20% = $20,000.

By holding for more than a year, the investor saves $17,000. That’s enough to buy a new car or fund a year of college tuition.

Conclusion: Actionable Takeaways

Capital gains tax can erode your investment returns, but with the right strategies, you can keep more of your profits. Here’s your action plan:

  • Always check the holding period. If you’re close to one year, wait until after the anniversary to sell.
  • Use tax-loss harvesting to offset gains and reduce ordinary income.
  • Maximize tax-advantaged accounts like IRAs and 401(k)s to avoid capital gains tax entirely.
  • Model your investments with our Investment Calculator and ROI Calculator to see the after-tax return.
  • Consult a tax professional for complex situations like gifting or charitable donations.

By being mindful of the tax implications, you can turn a good investment into a great one. Plan your trades, hold for the long term, and let the tax code work in your favor.

Advertisement
300×250
capital gainstaxesinvesting
Share: