How Capital Gains Tax Actually Works
When you sell an investment for more than you paid, the profit is called a capital gain. The IRS doesn't tax unrealized gains — only the profit you realize by selling. Your tax depends on three factors: the size of the gain, how long you held the asset, and your total taxable income for the year.
The U.S. tax code divides capital gains into two categories based on your holding period:
- Short-term gains — assets held for 1 year or less. Taxed at your ordinary income tax rate (10%–37% for 2026).
- Long-term gains — assets held for more than 1 year. Taxed at preferential rates of 0%, 15%, or 20%.
The holding period is measured from the day after you acquire the asset to the day you sell it. Selling on the 366th day qualifies as long-term. This single-day distinction can mean thousands of dollars in tax savings — a $50,000 gain might cost $18,500 in short-term tax (37%) versus $7,500 long-term (15%).
The Stacking Method: How Your Rate Is Determined
The IRS uses a "stacking" method to determine your capital gains rate. Your ordinary income fills the brackets first. Then your capital gains are "stacked on top" to determine which rate applies. This means someone with $40,000 in ordinary income and a $20,000 capital gain gets a different rate than someone with $500,000 in ordinary income and the same $20,000 gain.
This is why our calculator asks for both your annual income and your capital gain — both numbers are required to determine the correct rate.
2026 Long-Term Capital Gains Brackets
For the 2026 tax year (per IRS Rev. Proc. 2025-32), long-term capital gains rates are:
| Rate | Single | Married Filing Jointly | Head of Household |
| 0% | Up to $49,450 | Up to $98,900 | Up to $66,200 |
| 15% | $49,451 – $545,500 | $98,901 – $613,700 | $66,201 – $579,600 |
| 20% | Over $545,500 | Over $613,700 | Over $579,600 |
These thresholds are based on your total taxable income (ordinary income + capital gains combined), not just the gain alone.
The Net Investment Income Tax (NIIT)
High earners face an additional 3.8% surtax called the Net Investment Income Tax (IRC §1411). This applies when your Modified Adjusted Gross Income (MAGI) exceeds:
- $200,000 for single filers and head of household
- $250,000 for married filing jointly
- $125,000 for married filing separately
The NIIT is calculated on the lesser of your net investment income or the amount your MAGI exceeds the threshold. Unlike most tax brackets, these thresholds have not been adjusted for inflation since 2013, catching more taxpayers each year.
At the highest federal level, this means a combined rate of 20% + 3.8% = 23.8% on long-term capital gains — and potentially over 37% when state taxes are added in high-tax states like California (13.3%) or New York (10.9%).
State Capital Gains Taxes
Federal tax is only part of the picture. 41 states (plus D.C.) levy additional taxes on capital gains, typically treating them as ordinary income with no preferential rate. The impact varies dramatically by state:
- No state tax: Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington (except 7% on gains over $262,000), Wyoming
- Low rates (under 5%): Arizona (2.5%), Indiana (2.95%), Pennsylvania (3.07%), North Dakota (1.95%), Colorado (4.4%)
- High rates (over 9%): California (13.3%), New York (10.9%), New Jersey (10.75%), Oregon (9.9%), Minnesota (9.85%)
For a high earner in California, the total tax on a long-term capital gain can reach 37.1% (20% federal + 3.8% NIIT + 13.3% state) — nearly the same as the top ordinary income rate. This makes state-level planning critically important.
Cost Basis: The Starting Point of Every Calculation
Your capital gain is calculated as: Sale Price − Cost Basis = Capital Gain. Getting your cost basis right is the foundation of accurate tax calculation.
Cost basis includes:
- The original purchase price of the asset
- Commissions and transaction fees paid at purchase and sale
- Reinvested dividends (each reinvestment creates a new tax lot)
- Improvements made to real property (renovations, additions)
- Stock splits adjust per-share basis but not total basis
Inherited assets receive a "stepped-up" basis to fair market value at the date of death, effectively wiping out decades of unrealized gains. Gifted assets carry over the donor's original basis — the recipient inherits the embedded tax liability.
Specific Identification vs. FIFO
If you purchased the same stock at different times and prices, you have multiple "tax lots." When you sell, which lots are you selling? By default, the IRS uses FIFO (First In, First Out) — your oldest shares are sold first. However, you can use specific identification to designate which lots to sell, potentially choosing higher-cost lots to minimize your gain. You must identify the lots at the time of sale and your broker must confirm.
Key Tax-Saving Strategies
Several legal strategies can significantly reduce your capital gains tax burden:
- Tax-loss harvesting: Sell losing positions to offset gains. Net losses beyond your gains can offset up to $3,000 of ordinary income per year, with excess carrying forward indefinitely.
- 0% bracket harvesting: If your taxable income is below the 0% threshold ($49,450 single / $98,900 MFJ), you can sell appreciated assets completely tax-free to reset your cost basis.
- Charitable giving: Donate appreciated stock directly to charity. You avoid capital gains tax entirely and receive a deduction for the full fair market value.
- Hold for long-term treatment: If you're close to the 1-year mark, waiting even a single day can cut your rate from up to 37% down to 15% or even 0%.
- 1031 exchanges (real estate): Swap one investment property for another of equal or greater value. Capital gains tax is deferred indefinitely.
Our full tax reduction strategies guide covers 8 legal methods in detail, including Qualified Opportunity Zones and installment sales.
How to Report Capital Gains on Your Tax Return
Capital gains are reported using these IRS forms:
- Form 8949: Lists each individual sale with dates, proceeds, basis, and gain/loss
- Schedule D (Form 1040): Summarizes all capital gains and losses
- Form 1099-B: Sent by your broker each January with all sale details
- Form 8960: Calculates NIIT (only if applicable)
Most tax software can import your Form 1099-B directly from major brokerages. If you sold stock, crypto, real estate, or other assets during the year, you must report the transaction even if you had a net loss.
Estimated Tax Payments
If you expect to owe more than $1,000 in tax after subtracting withholding, you may need to make quarterly estimated payments to avoid underpayment penalties. Due dates for 2026: April 15, June 16, September 15, and January 15 (2027).
This is especially relevant for freelancers, retirees, and anyone with significant investment gains that aren't subject to employer withholding.
Special Situations
Cryptocurrency
The IRS treats cryptocurrency as property, not currency. Every sale, trade, swap, and use of crypto to purchase goods is a taxable event. However, crypto is currently exempt from the wash-sale rule, meaning you can sell at a loss and immediately repurchase to harvest losses — unlike stocks. See our crypto tax guide for complete details.
Real Estate
Homeowners can exclude up to $250,000 (single) or $500,000 (married) of gain from a primary residence sale under Section 121, provided they lived in the home for at least 2 of the last 5 years. Rental property owners face depreciation recapture taxed at 25% on top of regular capital gains rates. Read our real estate capital gains guide.
Mutual Funds and ETFs
Mutual funds may distribute capital gains to shareholders annually — you owe tax on these distributions even if you didn't sell any shares. These are reported on Form 1099-DIV. ETFs are generally more tax-efficient due to their in-kind creation/redemption process, which avoids triggering taxable events.