How to Calculate Capital Gains Tax in 2026
When you sell an investment for more than you paid, the profit is a capital gain, and the IRS wants its share. How much you owe depends on how long you held the asset, your total taxable income, and your filing status. With the right knowledge, you can structure your sales to minimize taxes legally and keep more of your investment profits. This guide covers the 2026 capital gains tax rates, calculation methods, and proven strategies for tax-efficient investing.
What Is Capital Gains Tax?
Capital gains tax is the tax levied on the profit from selling a capital asset. Capital assets include stocks, bonds, mutual funds, ETFs, real estate, collectibles, and virtually any property held for investment or personal use. The tax is owed only when a gain is realized, meaning you have actually sold the asset. Unrealized gains (paper profits on assets you still hold) are not taxed.
The amount of capital gains tax you owe depends on two factors: the holding period (how long you owned the asset) and your taxable income in the year of sale. These two variables determine whether your gain is classified as short-term or long-term, which significantly affects the tax rate.
Your basis in an asset is generally the purchase price plus any transaction costs (commissions, fees). The capital gain is calculated as the sale proceeds minus the adjusted basis. If you sell for less than your basis, you have a capital loss, which can offset gains and reduce your tax bill.
Short-Term vs Long-Term Capital Gains
Short-term capital gains apply to assets held for one year or less. These gains are taxed at your ordinary income tax rate, which ranges from 10% to 37% in 2026 depending on your total taxable income. For high earners, this means short-term gains can be taxed at rates more than double what long-term gains would cost.
Long-term capital gains apply to assets held for more than one year. These gains receive preferential tax rates of 0%, 15%, or 20%, depending on your taxable income and filing status. The preferential rates are designed to encourage long-term investment and reward patient capital allocation.
The difference in rates is substantial. A single filer in the 32% ordinary income bracket pays 32% on short-term gains but only 15% on long-term gains, saving $170 per $1,000 of profit. Over a portfolio of meaningful size, this holding period distinction can save tens of thousands of dollars annually.
Try Our ROI Calculator
Calculate your return on investment before and after capital gains tax to see the true net profit.
Use Calculator2026 Capital Gains Tax Rates
Long-Term Capital Gains Brackets (Single)
| Tax Rate | Taxable Income Range |
|---|---|
| 0% | $0 – $49,450 |
| 15% | $49,451 – $545,500 |
| 20% | $545,501+ |
Long-Term Capital Gains Brackets (Married Filing Jointly)
| Tax Rate | Taxable Income Range |
|---|---|
| 0% | $0 – $98,900 |
| 15% | $98,901 – $610,200 |
| 20% | $610,201+ |
Net Investment Income Tax (NIIT)
In addition to the base capital gains rate, high-income taxpayers may owe the 3.8% Net Investment Income Tax. This applies to individuals with modified adjusted gross income (MAGI) exceeding $200,000 (single) or $250,000 (married filing jointly). The NIIT is calculated on the lesser of net investment income or the amount by which MAGI exceeds the threshold. This means the maximum combined long-term capital gains rate is 23.8% (20% + 3.8% NIIT) for the highest earners.
How to Calculate Capital Gains Tax
Follow these steps to determine your capital gains tax liability:
Step 1: Determine your basis. This is your purchase price plus any commissions or fees paid when buying the asset. For mutual funds, remember to include reinvested dividends in your basis if they were taxed in prior years.
Step 2: Calculate the gain. Subtract your adjusted basis from the sale proceeds (net of selling costs). Sale proceeds of $50,000 minus a basis of $30,000 equals a $20,000 capital gain.
Step 3: Determine the holding period. Count from the day after acquisition to the sale date. More than 365 days qualifies as long-term.
Step 4: Identify the applicable rate. For short-term gains, use your ordinary income tax bracket. For long-term gains, use the 0%/15%/20% rate table based on your total taxable income (including the gain itself).
Step 5: Check for NIIT. If your MAGI exceeds $200,000 (single) or $250,000 (MFJ), add 3.8% NIIT on the applicable amount.
Real-World Examples
Example 1: Stock Sale at 0% Rate. Claire is a single filer with $35,000 in wages and $10,000 in long-term capital gains from selling index fund shares she held for three years. After the $16,100 standard deduction, her taxable income is $28,900 ($18,900 from wages + $10,000 gain). Since her total taxable income is below the $49,450 threshold, her entire $10,000 long-term gain is taxed at 0%. She owes no capital gains tax and keeps the full profit.
Example 2: Mixed Short-Term and Long-Term. Marcus earned $120,000 in salary, realized $8,000 in short-term gains from day trading, and $25,000 in long-term gains from selling shares held for two years. His short-term gains are taxed at his 24% ordinary rate ($1,920). After the standard deduction, his taxable income including gains is $136,900, placing his long-term gains in the 15% bracket ($3,750). His total capital gains tax is $5,670. If he had held the day-traded stocks for one more year, the short-term gains would have been taxed at 15% instead, saving him $720.
Example 3: High Earner With NIIT. Sophia has $300,000 in salary and sells rental property for a long-term gain of $200,000. Her total MAGI is $500,000. Her long-term gain is taxed at 20% ($40,000). Additionally, her MAGI exceeds the $200,000 NIIT threshold by $300,000, and her net investment income is $200,000. The NIIT is 3.8% of the lesser amount ($200,000), adding $7,600. Her total tax on the capital gain is $47,600, an effective rate of 23.8%.
Try Our Investment Calculator
Project your investment growth over time and see how reinvesting tax savings accelerates compound returns.
Use CalculatorCapital Gains on Real Estate
Real estate receives special treatment under the tax code. The most significant benefit is the Section 121 exclusion for primary residences: single filers can exclude up to $250,000 in capital gains, and married couples filing jointly can exclude up to $500,000, provided the home was the owner's primary residence for at least two of the five years preceding the sale.
For investment properties, there is no Section 121 exclusion. However, investors can use a Section 1031 like-kind exchange to defer capital gains tax by reinvesting the proceeds into a similar investment property within specific timelines (45 days to identify, 180 days to close). This strategy allows investors to grow their real estate portfolio without triggering immediate tax liability.
Real estate also involves depreciation recapture. If you claimed depreciation deductions on a rental property, the IRS recaptures that depreciation at a flat 25% rate when you sell. This is separate from and in addition to the capital gains tax on the remaining profit.
Strategies to Minimize Capital Gains Tax
Hold for more than one year. The simplest strategy is ensuring your holding period exceeds 12 months. This converts short-term gains (taxed at up to 37%) into long-term gains (taxed at 0%, 15%, or 20%). The savings can be dramatic at any income level.
Harvest losses to offset gains. If some investments are underwater, selling them generates capital losses that offset capital gains dollar for dollar. Excess losses can offset up to $3,000 of ordinary income annually, with the remainder carried forward. Many investors review their portfolios in November and December specifically for tax-loss harvesting opportunities.
Use the 0% bracket strategically. Single filers with taxable income below $49,450 pay 0% on long-term capital gains. Retirees, students, or anyone in a temporarily low-income year can harvest gains at 0% to reset their cost basis higher, eliminating future tax liability on those gains.
Invest through tax-advantaged accounts. Capital gains within Roth IRAs, traditional IRAs, and 401(k)s are not taxed when realized. Placing high-growth, high-turnover investments in these accounts avoids capital gains tax entirely (Roth) or defers it until withdrawal (traditional).
Gift appreciated assets. Donating appreciated stock to a qualified charity lets you deduct the full fair market value while avoiding capital gains tax entirely. You receive the double benefit of a charitable deduction and zero tax on the gain. For gifts to individuals, the recipient takes your basis and holding period.
Consider installment sales. Spreading the proceeds of a large sale over multiple tax years through an installment sale can keep your taxable income in lower brackets, potentially reducing both the capital gains rate and exposure to NIIT.
Common Mistakes to Avoid
Ignoring the wash-sale rule. If you sell a stock at a loss and buy back the same or substantially identical security within 30 days (before or after), the loss is disallowed for tax purposes. Many investors inadvertently trigger wash sales through automatic dividend reinvestment programs.
Forgetting about state capital gains taxes. While this article focuses on federal rates, many states also tax capital gains. California taxes long-term gains at the same rate as ordinary income (up to 13.3%). Always factor state taxes into your capital gains projections.
Miscalculating basis in mutual funds. Mutual fund investors who reinvest dividends often forget to include those reinvested amounts in their basis. This leads to double taxation: once when the dividend is received and again when the shares are sold. Keep meticulous records or use the average cost method offered by most brokerages.
Selling just before the long-term threshold. Selling an asset one day too early can cost thousands in extra taxes. Always verify the acquisition date before executing a sale, especially for positions approaching the one-year mark.
Try Our Average Return Calculator
Calculate your average annualized return accounting for capital gains, dividends, and your tax rate.
Use CalculatorFrequently Asked Questions
You must hold an asset for more than one year (at least one year and one day) before selling it to qualify for long-term capital gains treatment. The holding period begins the day after you acquire the asset and ends on the day you sell it. For example, if you purchase stock on March 15, 2025, you must sell it on March 16, 2026, or later for long-term treatment. If you sell on March 15, 2026, or earlier, the gain is classified as short-term and taxed at ordinary income rates. This distinction can mean a tax rate difference of 10% or more.
Inherited property receives a stepped-up basis equal to the fair market value of the asset on the date of the decedent's death. This means if your parent purchased stock for $10,000 that was worth $100,000 at their death, your basis is $100,000. If you sell it for $105,000, you only owe tax on the $5,000 gain. This stepped-up basis eliminates tax on all appreciation during the original owner's lifetime and is one of the most significant tax benefits in the code. The gain from your stepped-up basis is long-term regardless of how long you hold the inherited asset.
Yes, but with limits. Capital losses first offset capital gains of the same type (short-term losses offset short-term gains, long-term losses offset long-term gains). Any remaining net capital losses can offset up to $3,000 of ordinary income per year ($1,500 for married filing separately). Losses exceeding $3,000 are carried forward indefinitely to future tax years. For example, if you have $15,000 in capital losses and $5,000 in capital gains, your net loss of $10,000 offsets $3,000 of ordinary income this year, with $7,000 carried to next year.
Most homeowners do not. The Section 121 exclusion allows single filers to exclude up to $250,000 in capital gains from the sale of their primary residence, and married couples filing jointly can exclude up to $500,000. You must have owned and lived in the home for at least two of the five years before the sale. If your gain exceeds these thresholds, only the excess is taxed at long-term capital gains rates. This exclusion makes the primary residence one of the most tax-advantaged assets available.
The Net Investment Income Tax (NIIT) is an additional 3.8% tax on investment income for high earners. It applies to individuals with modified adjusted gross income (MAGI) above $200,000 for single filers or $250,000 for married filing jointly. The 3.8% tax is levied on the lesser of your net investment income or the amount by which your MAGI exceeds the threshold. For capital gains, this means a high-earning single filer could pay up to 23.8% on long-term capital gains (20% base rate plus 3.8% NIIT).
Qualified dividends are taxed at the same preferential rates as long-term capital gains (0%, 15%, or 20%). To qualify, dividends must be paid by a U.S. corporation or a qualified foreign corporation, and you must hold the stock for a minimum holding period (more than 60 days during the 121-day period surrounding the ex-dividend date). Non-qualified (ordinary) dividends, such as those from REITs and money market funds, are taxed at your ordinary income tax rate. The distinction between qualified and ordinary dividends can make a significant difference at higher income levels.
Tax-loss harvesting involves selling investments at a loss to offset capital gains and reduce your tax bill. You sell a losing position, realize the loss for tax purposes, and then reinvest the proceeds in a similar (but not substantially identical) asset to maintain your portfolio allocation. The wash-sale rule prevents you from buying back the same or substantially identical security within 30 days before or after the sale. Losses first offset gains of the same type, then offset up to $3,000 of ordinary income, with any excess carried forward to future years.
Sources & References
CalculatorGlobe Team
Content & Research Team
The CalculatorGlobe team creates in-depth guides backed by authoritative sources to help you understand the math behind everyday decisions.
Related Calculators
ROI Calculator
Calculate return on investment for any asset or project.
Investment Calculator
Project compound investment growth over time.
Average Return Calculator
Compute average annualized returns across periods.
Compound Interest Calculator
See how reinvested gains compound over decades.
Percentage Calculator
Calculate any percentage quickly and accurately.
Date Calculator
Calculate important dates for tax filing deadlines and holding periods.
Related Articles
How Compound Interest Works: Formula, Examples & Calculator
Learn how compound interest grows your money exponentially with real-world examples, formulas, and a free calculator to project your savings over time.
How to Calculate Mortgage Payments Step by Step
Calculate monthly mortgage payments using the amortization formula with step-by-step examples covering principal, interest, taxes, and insurance costs.
APR vs Interest Rate: What's the Difference?
Understand the key difference between APR and interest rate, how each affects your loan costs, and which number matters more when comparing mortgage offers.
How to Calculate Your Net Worth (With Examples)
Calculate your net worth by listing all assets and liabilities with practical examples, common mistakes to avoid, and benchmarks by age for comparison.
Disclaimer: This calculator is for informational purposes only and does not constitute financial advice. Consult a qualified financial advisor before making financial decisions.
Last updated: February 23, 2026