Capital Gains Tax Calculator
Estimate federal tax on investment profits including the 0%/15%/20% long-term rates and the 3.8% Net Investment Income Tax under IRC Section 1411.
What Is the Capital Gains Tax Calculator?
Capital gains tax applies when you sell a capital asset (stocks, bonds, real estate, cryptocurrency, collectibles) for more than your cost basis. The tax rate depends on how long you held the asset. Short-term gains on assets held one year or less are taxed as ordinary income at your marginal bracket rate (up to 37% for 2025). Long-term gains on assets held more than one year receive preferential rates: 0% for taxable income up to $48,350 (single) or $96,700 (MFJ), 15% up to $533,400 (single) or $600,050 (MFJ), and 20% above those thresholds. On top of that, the Net Investment Income Tax (NIIT) under IRC Section 1411 imposes a 3.8% surtax on investment income (including capital gains) for taxpayers with modified AGI exceeding $200,000 (single) or $250,000 (MFJ). Collectibles (art, coins, antiques) are taxed at a maximum 28% rate regardless of holding period. Unrecaptured Section 1250 gain on depreciated real property is taxed at a maximum 25% rate. Capital losses offset capital gains dollar-for-dollar, and up to $3,000 of excess losses can be deducted against ordinary income annually, with the remainder carrying forward indefinitely.
How to Use This Calculator
Enter Sale Price and Cost Basis
Input the total proceeds from the sale and your original cost basis (purchase price plus commissions, fees, and improvements). The difference is your capital gain.
Select Holding Period
Choose short-term (1 year or less) or long-term (more than 1 year). This determines which tax rate schedule applies.
Enter Other Taxable Income
Provide your other taxable income (wages, business income, etc.) to determine which long-term rate bracket applies and whether the NIIT surtax is triggered.
Review Total Tax Impact
The calculator shows capital gains tax, NIIT if applicable, total tax, and your net after-tax proceeds from the sale.
Key Concepts
Long-Term vs. Short-Term
Assets held over one year qualify for preferential 0%/15%/20% rates. Assets held one year or less are taxed at ordinary income rates up to 37%.
Net Investment Income Tax (NIIT)
A 3.8% surtax on investment income for AGI above $200K (single) or $250K (MFJ). These thresholds are not indexed for inflation.
Cost Basis
Your original purchase price plus commissions, fees, and improvements. Inherited assets receive a stepped-up basis to FMV at date of death under IRC Section 1014.
Capital Loss Offset
Losses offset gains dollar-for-dollar. Net losses up to $3,000/year ($1,500 MFS) deduct against ordinary income. Excess carries forward indefinitely.
Wash Sale Rule (IRC 1091)
You cannot deduct a loss if you buy substantially identical securities within 30 days before or after the sale. The disallowed loss is added to the new position's basis.
Section 121 Home Sale Exclusion
Exclude up to $250K ($500K MFJ) of gain on the sale of a primary residence if you lived there 2 of the last 5 years.
Expert Insights
The One-Day Rule: The most impactful capital gains strategy is simply holding assets past the one-year mark. The rate difference between short-term (up to 37%) and long-term (0-20%) can be enormous. On a $100,000 gain for someone in the 35% bracket, selling one day early costs an additional $15,000-$20,000 in federal tax. For investors, this means resisting the urge to sell profitable positions before the 366-day holding period is reached.
Tax-Loss Harvesting: By strategically selling losing positions to offset gains, you can reduce your current-year tax bill while maintaining market exposure by purchasing a similar (but not "substantially identical") security. A total market fund can replace an S&P 500 fund without triggering the wash sale rule. At higher income levels, the NIIT surtax adds 3.8%, making the effective maximum rate on long-term gains 23.8%. Since the NIIT thresholds ($200K/$250K) are not indexed for inflation, more taxpayers are caught by it each year.
Gain Harvesting at 0%: If you are in the 0% long-term capital gains bracket (taxable income under $48,350 single / $96,700 MFJ for 2025), consider intentionally realizing gains to "reset" your cost basis to a higher level. This is especially valuable in early retirement or gap years when your income dips below the 0% threshold.
Frequently Asked Questions
This calculator provides estimates for educational purposes only. Tax laws change frequently and individual circumstances vary. These estimates do not constitute tax advice. Consult a qualified CPA or tax professional before making tax-related decisions.
Run These Numbers Too
Small Business Tax Estimator
Project your combined federal income tax, self-employment tax, and Section 199A QBI deduction as a sole proprietor, LLC, or S-corp.
Quarterly Tax Payment Calculator
Determine the correct Form 1040-ES payment for each quarter based on projected income, deductions, and safe harbor rules under IRC Section 6654.
MACRS Depreciation Calculator
Generate year-by-year depreciation schedules using the Modified Accelerated Cost Recovery System under IRC Section 168.
Minimize Your Capital Gains Tax
Compare top-rated investment platforms and tax-efficient strategies reviewed by our editorial team.
See Best Investing Platforms