Capital gains tax applies when you sell an asset — stocks, bonds, real estate, cryptocurrency, or collectibles — for more than your purchase price. The tax rate depends on how long you held the asset and your total taxable income. Short-term capital gains on assets held less than one year are taxed as ordinary income at rates from 10% to 37%. Long-term capital gains on assets held longer than one year receive preferential rates of 0%, 15%, or 20%. This capital gains tax calculator estimates your federal and state tax liability from any asset sale, factoring in your filing status, total income, holding period, purchase and sale prices, and transaction fees. It identifies whether your gain qualifies for long-term or short-term treatment, applies the correct 2024 federal bracket, adds the 3.8% Net Investment Income Tax (NIIT) for high earners, and includes optional state capital gains tax. The result shows your total tax bill, effective tax rate, and after-tax profit — the information you need to plan asset sales strategically and minimize your tax burden through timing, tax-loss harvesting, and other legitimate strategies.
2024 Long-Term Capital Gains Tax Brackets
For 2024, long-term capital gains tax rates depend on your taxable income and filing status. Single filers pay 0% on gains up to $47,025, 15% on gains from $47,026 to $518,900, and 20% on gains above $518,900. Married filing jointly, the thresholds are $94,050 for the 0% bracket and $583,750 for the 20% bracket. These brackets are indexed for inflation annually. The 0% bracket is particularly valuable for retirees and others with moderate income — if your total taxable income including gains stays below the threshold, you owe zero federal tax on those gains. Strategic tax planning involves 'filling up' the 0% bracket each year by selling appreciated assets in low-income years. Additionally, taxpayers with modified adjusted gross income above $200,000 (single) or $250,000 (married filing jointly) owe an additional 3.8% NIIT on the lesser of net investment income or the excess over the threshold. Combined, the maximum federal rate on long-term gains is 23.8%.
Short-Term vs. Long-Term: The One-Year Holding Period Rule
The difference between short-term and long-term capital gains rates is substantial — up to 17.2 percentage points for high earners (37% ordinary rate vs. 20% long-term rate, before NIIT). The holding period is measured from the day after you acquire the asset to the day you sell it. If you buy stock on January 15, 2024, you must sell on or after January 16, 2025 to qualify for long-term treatment. For tax-loss harvesting, the wash sale rule prevents you from claiming a loss if you repurchase the same or substantially identical security within 30 days before or after the sale. Real estate held over one year qualifies for long-term rates, but depreciation recapture on rental property is taxed at a flat 25% regardless of holding period. Cryptocurrency follows the same short-term and long-term rules as stocks. For active traders making frequent short-term trades, the tax drag can significantly reduce after-tax returns — a 30% pre-tax return becomes approximately 19.5% after short-term capital gains tax for someone in the 35% bracket.
Strategies to Legally Minimize Capital Gains Tax
Several legitimate strategies can reduce or defer capital gains tax. Tax-loss harvesting involves selling losing positions to offset gains — you can offset unlimited gains with losses, and deduct up to $3,000 of net losses against ordinary income annually, carrying forward excess losses indefinitely. Donating appreciated stock to charity lets you deduct the full market value without paying capital gains tax. Opportunity Zone investments allow deferral and partial exclusion of capital gains when invested in qualified zones. The primary residence exclusion lets homeowners exclude up to $250,000 ($500,000 married) of gain when selling a home they have lived in for 2 of the past 5 years. For real estate investors, 1031 like-kind exchanges defer capital gains tax by rolling proceeds into a replacement property within 180 days. Installment sales spread the gain over multiple years, potentially keeping you in lower brackets. Finally, holding appreciated assets until death provides a step-up in basis to the heir, permanently erasing the unrealized gain.