Free ToolInstant ResultsUpdated April 2026

Capital Gains Tax Calculator

Calculate your capital gains tax on stocks, crypto, real estate, and other investments. Compare short-term vs long-term rates, estimate the NIIT, and plan your investment tax strategy.

Investment Details
$
$
$

Improvements, commissions, fees

$

Wages, salary, other income (affects LT bracket)

Net Capital Gain

$30,000.00

Capital Gains Tax

$4,500.00

Net After Tax

$75,500.00

Effective Tax Rate

15.0%

Gain/Loss Breakdown
Purchase Price$50,000.00
Cost Basis Adjustments$0.00
Adjusted Cost Basis$50,000.00
Sale Price$80,000.00
Net Capital Gain$30,000.00
Long-Term Tax (15% rate)$4,500.00
Total Tax$4,500.00
Net Proceeds After Tax$75,500.00
Short-Term vs Long-Term Tax

Short-term gains are taxed as ordinary income, which is typically higher than long-term rates.

Sale Proceeds Breakdown
Net After Tax
LT Tax (15.0%)

Long-Term Tax Savings: $2,100.00

By holding your investment for more than one year, you could save $2,100.00 in taxes on this transaction. Long-term capital gains are taxed at preferential rates (0%, 15%, or 20%) compared to ordinary income rates.

This calculator provides estimates based on 2024 federal tax rules. Long-term capital gains rates depend on your taxable income. The Net Investment Income Tax (NIIT) of 3.8% applies when your modified AGI exceeds $200,000 (single) or $250,000 (MFJ). Consult a tax professional for personalized advice.

Related Calculators

How to Use This Calculator

  1. 1

    Enter Purchase and Sale Prices

    Input the price you paid for the investment (purchase price) and the price at which you sold it (sale price). The difference between these determines your capital gain or loss.

  2. 2

    Select Holding Period

    Choose short-term (held less than one year) or long-term (held more than one year). This is critical because short-term gains are taxed at ordinary income rates while long-term gains enjoy preferential rates.

  3. 3

    Add Cost Basis Adjustments

    Include any additional costs that increase your cost basis, such as improvements to a property, brokerage commissions, or transaction fees. These reduce your taxable gain.

  4. 4

    Enter Your Other Income

    Input your annual income from other sources (salary, wages, etc.). For long-term gains, your other income determines which preferential rate (0%, 15%, or 20%) applies to your capital gains.

  5. 5

    Review Tax Estimates and Comparison

    View your estimated capital gains tax, the comparison between short-term and long-term tax treatment, and the potential tax savings from holding investments longer than one year.

Real-World Examples

1Stock Investment with Long-Term Holding

Purchase Price:$25,000
Sale Price:$55,000
Holding Period:Long-Term (>1 year)
Other Income:$80,000
Tax on $30,000 Gain:~$4,500

As a single filer with $80,000 in other income, your $30,000 gain falls in the 15% long-term capital gains bracket. The tax is $4,500 instead of approximately $6,600 if it were short-term – a savings of $2,100.

2Cryptocurrency Day Trader (Short-Term)

Purchase Price:$10,000
Sale Price:$18,000
Holding Period:Short-Term (<1 year)
Other Income:$75,000
Tax on $8,000 Gain:~$1,760

Short-term capital gains from crypto trading are taxed as ordinary income. Your $8,000 gain pushes into the 22% bracket, resulting in $1,760 in federal tax. Holding crypto for over a year could reduce this rate to 15% or even 0%.

3Low-Income Investor with 0% Rate

Purchase Price:$5,000
Sale Price:$15,000
Holding Period:Long-Term (>1 year)
Other Income:$35,000
Tax on $10,000 Gain:$0

As a single filer with $35,000 in other income plus $10,000 in long-term gains, your total taxable income is $45,000, which falls below the 0% capital gains threshold of $47,025. You owe zero federal tax on this gain!

Frequently Asked Questions

Short-term capital gains apply to investments held for one year or less and are taxed at your ordinary income tax rates (10% to 37%). Long-term capital gains apply to investments held for more than one year and are taxed at preferential rates of 0%, 15%, or 20%, depending on your taxable income. This is one of the most significant tax advantages available to investors. The difference between the two can be substantial: if you are in the 22% ordinary income bracket, holding an asset for just over a year instead of selling it at 11 months could reduce your tax rate on the gain from 22% to 15%.

The Complete Guide to Capital Gains Taxes on Investments

Capital gains tax is one of the most important tax considerations for investors in the United States. Whether you are trading stocks, investing in cryptocurrency, selling real estate, or managing a diversified investment portfolio, understanding how capital gains are taxed can save you thousands of dollars and help you make more informed investment decisions. The US tax code provides a significant advantage for patient investors through preferential long-term capital gains rates, making the distinction between short-term and long-term holdings one of the most impactful tax planning strategies available to individual investors. Anyone who buys and sells assets — from individual stocks and ETFs to rental properties and digital currencies — needs to understand these rules to maximize their after-tax returns and avoid costly surprises at tax time.

How Capital Gains Tax Is Calculated

Capital gains tax is calculated on the profit you make when you sell an investment for more than you paid for it — not on the full sale price. The formula is straightforward: Capital Gain equals Sale Price minus Adjusted Cost Basis. Your cost basis is what you originally paid for the asset, and it can be increased by certain expenses such as brokerage commissions, improvement costs for real estate, and transaction fees. For example, if you bought shares for $10,000, paid $100 in commissions, and sold them for $18,000, your adjusted cost basis is $10,100, your capital gain is $7,900, and tax is owed only on that $7,900 gain — not on the full $18,000 sale price. The tax rate applied to your gain depends on your holding period (how long you owned the asset) and your taxable income level, which is determined after applying the 2024 standard deduction of $14,600 for single filers or $29,200 for married filing jointly. The 2024 US tax brackets for ordinary income range from 10% to 37%, and these brackets directly apply to short-term capital gains.

It is equally important to understand what happens when you sell at a loss. If your sale price is lower than your adjusted cost basis, you realize a capital loss. Capital losses can be used to offset capital gains dollar-for-dollar, and if your losses exceed your gains, you can deduct up to $3,000 per year ($1,500 for married filing separately) against your ordinary income. Any unused losses carry forward indefinitely to future tax years. This ability to harvest losses and carry them forward makes tax-loss harvesting one of the most valuable tax strategies available to investors in taxable brokerage accounts, though it does not apply within tax-advantaged accounts like IRAs or 401(k)s.

Short-Term vs Long-Term: A Critical Tax Distinction

The most important factor in determining your capital gains tax rate is how long you have held the investment before selling. Investments held for one year or less produce short-term capital gains, which are taxed at your ordinary income tax rate — the same rate that applies to your salary and wages, using the seven US tax brackets ranging from 10% to 37%. This means short-term gains can be taxed at rates as high as 37% for the highest earners. In contrast, investments held for more than one year produce long-term capital gains, which benefit from preferential tax rates of 0%, 15%, or 20% depending on your taxable income level. For example, an investor in the 24% ordinary income bracket who holds a stock for just under a year would pay 24% on the gain. By holding the same stock for just over a year, the rate drops to 15% — a savings of 9 percentage points. On a $50,000 gain, that is a difference of $4,500 in taxes owed, purely from waiting a few extra weeks or months to cross the one-year threshold.

The 0% long-term rate is perhaps the most underutilized tax benefit in the entire US tax code. For 2024, single filers with taxable income up to $47,025 (or $94,050 for married filing jointly) pay absolutely zero federal tax on long-term capital gains. This means that low-to-moderate income earners — including early retirees, students, and those taking a sabbatical year — can realize substantial investment gains completely tax-free, provided they hold their investments for more than one year. The middle bracket at 15% covers most middle-class and upper-middle-class investors with income up to $518,900 for single filers and $583,750 for married filing jointly. Only the highest earners, with income above those thresholds, pay the top rate of 20%, and they may also face the additional 3.8% Net Investment Income Tax (NIIT), pushing their effective top rate to 23.8%.

Key Factors That Affect Your Capital Gains Tax

  • Holding Period: The single most important factor in your capital gains tax. Holding an investment for more than one year before selling switches the tax treatment from ordinary income rates (10% to 37%) to preferential long-term rates (0%, 15%, or 20%). This one-year difference can save tens of thousands of dollars on large gains. Always check your purchase date before selling.
  • Your Total Taxable Income: For long-term gains, your other income (wages, salary, business income) determines which preferential rate bracket applies. Single filers with total taxable income up to $47,025 pay 0% on long-term gains, $47,026 to $518,900 pay 15%, and above $518,900 pay 20%. Use the Income Tax Calculator to estimate your taxable income after the standard deduction.
  • Net Investment Income Tax (NIIT): High-income earners face an additional 3.8% tax on net investment income when their modified AGI exceeds $200,000 (single) or $250,000 (married filing jointly). This effectively raises the top long-term rate from 20% to 23.8% for affected taxpayers, making timing of gain realization especially important near this threshold.
  • Cost Basis Adjustments: Commissions, fees, and improvement costs (for real estate) increase your cost basis and reduce your taxable gain. Keeping accurate records of all transaction costs and capital improvements is essential for minimizing your tax liability over the life of an investment and avoiding unnecessary overpayment.
  • Asset Type: Different assets have different rules. Collectibles (art, coins, wine) are taxed at a maximum 28% rate regardless of holding period. Real estate benefits from the primary residence exclusion ($250,000 single / $500,000 MFJ) and 1031 exchange deferral for investment properties. Cryptocurrency is treated as property, meaning every trade, swap, or purchase with crypto is a taxable event.

💡 Pro Tip

Before selling a profitable investment, check whether your total taxable income falls below the 0% long-term capital gains threshold ($47,025 for single filers or $94,050 for married filing jointly in 2024). If you are close, you may be able to realize gains completely tax-free by selling in a year when your income is lower — such as during a gap in employment, a sabbatical, between jobs, or in early retirement before Social Security and required minimum distributions begin.

Understanding the Long-Term Capital Gains Brackets

Long-term capital gains rates are tied to your taxable income, not the size of the gain itself, which is a crucial distinction that many investors misunderstand. For 2024, single filers with taxable income up to $47,025 (or $94,050 for married filing jointly) pay 0% on long-term capital gains. This means that even investors with substantial portfolios can realize gains completely tax-free if their overall taxable income remains below the threshold. The middle bracket, at 15%, covers the vast majority of middle-class and upper-middle-class investors, applying to income up to $518,900 for single filers and $583,750 for married filing jointly. Only the highest earners, with income above those thresholds, pay the top rate of 20%. When combined with the standard deduction of $14,600 (single) or $29,200 (MFJ), these thresholds mean that a married couple with $120,000 in total income and $30,000 in long-term gains could pay just 15% on the gains — a rate far lower than most people assume. These preferential rates represent one of the most powerful tax advantages available to everyday investors and form the foundation of buy-and-hold investment strategies recommended by financial advisors.

Tax-Loss Harvesting: Turning Losses into Tax Savings

Tax-loss harvesting is a strategy where you sell investments that have declined in value to realize a capital loss, which can then be used to offset capital gains and reduce your overall tax liability. If your losses exceed your gains, you can deduct up to $3,000 per year ($1,500 for married filing separately) against ordinary income, and carry forward any unused losses to future years indefinitely. For example, if you have $20,000 in gains and $15,000 in losses, your net taxable gain is only $5,000. If you have $20,000 in gains and $25,000 in losses, you can offset all $20,000 in gains plus deduct $3,000 against ordinary income, and carry forward the remaining $2,000 in losses. This strategy is especially valuable in taxable brokerage accounts (it does not apply to tax-advantaged accounts like IRAs or 401(k)s where gains are already tax-sheltered). The key rule to remember is the wash-sale rule: if you sell a security at a loss and buy a substantially identical security within 30 days before or after the sale, the loss is disallowed for tax purposes. Many modern brokerages offer automated tax-loss harvesting tools to help investors execute this strategy systematically throughout the year.

Practical Tips for Minimizing Capital Gains Tax

  • Hold investments longer than one year: The simplest and most effective strategy. The difference between the short-term ordinary rate and the long-term preferential rate can be as much as 22 percentage points (37% vs 15%). Before selling a short-term gain, always consider whether waiting a few more months to cross the one-year threshold would save you significant tax. On a $100,000 gain, the difference between 37% and 15% is $22,000.
  • Harvest losses systematically: Review your portfolio at least quarterly and especially before year-end to identify losing positions. Selling these to offset gains can meaningfully reduce your tax bill. Many robo-advisors and brokerage platforms like Schwab, Fidelity, and Wealthfront now offer automated tax-loss harvesting features at little or no additional cost.
  • Donate appreciated assets to charity: If you itemize deductions, donating stocks that have appreciated in value allows you to deduct the full market value without paying capital gains tax on the appreciation. This is significantly more tax-efficient than selling the stock, paying tax on the gain, and donating the remaining cash.
  • Use tax-advantaged accounts: Holding investments that generate frequent gains inside IRAs, 401(k)s, or other tax-advantaged accounts shields all gains from current taxation. You can buy, sell, and rebalance freely without triggering any capital gains tax. Only withdrawals from traditional accounts are taxed as ordinary income, and qualified Roth withdrawals are completely tax-free.
  • Be strategic with gain realization: If you have both short-term and long-term positions with gains, consider selling long-term positions first to take advantage of the lower rates. Also consider spreading large gain realizations across multiple tax years to stay within lower rate brackets.

Common Mistakes Investors Make with Capital Gains

  • Selling before the one-year anniversary: This is the most common and most costly mistake investors make. Holding for just over 12 months instead of selling at 11 months can reduce your tax rate from up to 37% to as low as 0%. Always check the exact purchase date before selling, and if you are within a few weeks of the one-year mark, consider waiting.
  • Triggering the wash-sale rule: Selling a losing stock and immediately repurchasing it (or a nearly identical mutual fund or ETF) within 30 days disallows the loss for tax purposes. Wait at least 31 days before repurchasing, or buy a similar but not substantially identical investment to maintain your portfolio exposure while claiming the loss.
  • Ignoring cost basis on reinvested dividends: When dividends are automatically reinvested through a DRIP plan, each reinvestment creates a new purchase with its own cost basis and holding period. Failing to track these individual lots can result in overpaying tax when you eventually sell. Most brokerages now track this automatically, but verify your records.
  • Forgetting about the NIIT: High-income investors who are close to the $200,000/$250,000 MAGI threshold may trigger the 3.8% Net Investment Income Tax without realizing it. Strategic timing of gain realization — spreading large sales across multiple tax years — can help avoid or minimize this additional tax.
  • Treating all crypto transactions as non-taxable: Cryptocurrency is treated as property by the IRS. Every trade, swap between cryptocurrencies, and purchase using crypto is a taxable event that triggers capital gains or losses. Failing to report these transactions can result in penalties, interest, and audits.

When to Use This Calculator vs. Alternatives

The Capital Gains Tax Calculator is specifically designed for investors who want to estimate the tax impact of selling an investment. It compares short-term and long-term treatment side by side and factors in the NIIT for high earners, giving you a clear picture of the tax savings from holding longer. For a broader picture of your overall federal tax situation including ordinary income and credits, use the Federal Tax Calculator. If you are self-employed and have both business income and investment gains, combine this calculator with the Self-Employment Tax Calculator for a complete picture. To estimate long-term portfolio growth after taxes, the Investment Return Calculator can help model your after-tax returns over time and show how taxes compound against your wealth.

Capital Gains on Special Asset Classes

Different types of investments have unique capital gains tax rules that can significantly impact your tax planning. Collectibles (art, coins, wine, stamps, and other tangible assets) are taxed at a maximum rate of 28% regardless of holding period, which is higher than the 15% rate most investors pay on stocks held long-term. Real estate benefits from the primary residence exclusion, which allows you to exclude up to $250,000 of gain ($500,000 for married filing jointly) provided you owned and lived in the home for at least two of the five years before the sale. Investment properties that do not qualify for the exclusion can defer gains indefinitely through 1031 exchanges, which allow you to reinvest proceeds into similar properties without triggering tax. Cryptocurrency is treated as property for tax purposes by the IRS, meaning every trade, swap, or use to purchase goods is potentially a taxable event — making it one of the most complex asset classes to manage from a tax perspective. Qualified small business stock (Section 1202) may allow you to exclude up to $10 million of gain if held for more than five years, providing a powerful incentive for early-stage investors. Understanding these nuances can help you structure your investment strategy to minimize taxes and maximize after-tax returns over the long term.

Related Calculators

Disclaimer: All calculations are estimates based on current tax rules and regulations. Actual values may vary depending on your specific circumstances. Please consult a certified financial advisor or CPA for personalized advice.