The short answer
- Gain = sale price − cost basis − selling costs.
- Held a year or less: taxed like wages, at 10% to 37%.
- Held more than a year: taxed at 0%, 15% or 20%, depending on your total taxable income.
- High earners may add the 3.8% net investment income tax, and most states tax gains too.
What a capital gain is
A capital asset is almost anything you own for personal use or investment: shares, ETFs and mutual funds, bonds, crypto, your home, land, a rental property, art and collectibles. You have a gain only when you sell or swap the asset. A rise in value while you keep holding it is an unrealized gain and is not taxed.
Mutual funds also pay out capital gain distributions each year, which are taxed as long-term gains even if you never sold a share.
Cost basis
Your cost basis is what you paid, plus buying costs such as commissions. For a home it also includes the cost of improvements (a new roof or a kitchen, not repairs). Reinvested dividends add to the basis of a fund. Inherited assets get a "stepped-up" basis equal to the value on the date of death, so gains before then are never taxed. Gifts usually keep the giver’s basis.
Keep your records
Brokers report basis on Form 1099-B for shares bought since 2011. For older holdings, crypto and property, it is up to you to prove it.
Short-term and long-term
The holding period starts the day after you buy and includes the day you sell. More than one year is long-term. Selling one day too soon can cost real money:
- Federal tax
- $3,750
- Share of the gain
- 18.8%
- Federal tax
- $2,167.50
- Share of the gain
- 10.8%
The 2026 long-term rates
| Filing status | 0% up to | 15% up to | 20% above |
|---|---|---|---|
| Single | $49,450 | $545,500 | $545,500 |
| Married filing jointly | $98,900 | $613,700 | $613,700 |
| Married filing separately | $49,450 | $306,850 | $306,850 |
| Head of household | $66,200 | $579,600 | $579,600 |
Qualified dividends from most US shares and many foreign ones use the same rates.
How gains stack on your income
Long-term gains are counted last, on top of your ordinary taxable income (wages, interest and short-term gains after deductions). The part of the gain that fits under the 0% line is tax-free, the next part is taxed at 15%, and anything above the 15% line at 20%. Your gain never pushes your wages into a higher bracket.
Example: a $20,000 gain
- Taxable wages ($60,000 − $16,100)$43,900
- Room left under $49,450$5,550
- $5,550 of the gain at 0%$0
- $14,450 of the gain at 15%$2,167.50
That is 10.8% of the gain. The tax on the wages themselves is unchanged.
The 0% rate
Many people pay no federal tax on long-term gains at all. A married couple filing jointly with $100,000 of wages has $67,800 of taxable income, so a $20,000 gain fits under the $98,900 line and is taxed at 0%. With the standard deduction, a couple can have up to $131,100 of total income, gains included, and still pay 0% on the gains.
Retirees and people between jobs often use low-income years to "harvest" gains at 0%: sell, then buy back straight away to reset the cost basis higher. The wash-sale rule only applies to losses, not gains.
The 3.8% net investment income tax
The net investment income tax (NIIT) adds 3.8% on the smaller of your investment income and your modified AGI above $200,000 (single or head of household), $250,000 (married filing jointly) or $125,000 (married filing separately). These lines are not raised for inflation.
- 15% of $50,000$7,500
- NIIT: 3.8% of $50,000$1,900
Tax on a $50,000 gain at different incomes
| Other income (wages) | Long-term | Share | Short-term |
|---|---|---|---|
| $20,000 | $668 | 1.3% | $6,180 |
| $40,000 | $3,668 | 7.3% | $8,350 |
| $60,000 | $6,668 | 13.3% | $10,350 |
| $100,000 | $7,500 | 15.0% | $11,564 |
| $200,000 | $9,400 | 18.8% | $16,470 |
| $400,000 | $9,400 | 18.8% | $19,400 |
Long-term tax on a $50,000 gain. The $200,000 and $400,000 rows include the 3.8% NIIT.
Capital losses
Losses offset gains first: short-term losses against short-term gains, long-term against long-term, then across. If losses are bigger, up to $3,000 of the net loss ($1,500 married filing separately) comes off your other income each year, and the rest carries forward with no time limit.
A single person with $60,000 of wages, a $4,000 gain and $10,000 of losses has a $6,000 net loss. They deduct $3,000 this year, saving $360 of federal tax at 12%, and carry $3,000 forward to 2027.
The wash-sale rule
If you buy the same or a substantially identical security within 30 days before or after selling at a loss, the loss is disallowed for now and added to the basis of the new shares.
Selling your home
If you owned your main home and lived in it for at least 2 of the 5 years before the sale, up to $250,000 of gain is tax-free, or $500,000 for a married couple filing jointly where both meet the living test. You can use the exclusion once every two years. A loss on your own home is not deductible.
- Gain$600,000
- Home sale exclusion−$500,000
- Taxable long-term gain$100,000
Improvements over the years raise your basis and shrink the gain, so keep the receipts. A partial exclusion may apply if you move early for a new job, health or another unforeseen reason. Planning the next purchase? The mortgage calculator and home affordability calculator help with the numbers.
Rental and investment property
Rental and second homes do not get the exclusion. Depreciation you claimed (or could have claimed) is "recaptured" and taxed at up to 25%, with the rest of the gain at the normal long-term rates. A 1031 like-kind exchange can defer the tax if you reinvest in other investment real estate within strict time limits.
Crypto, collectibles and special cases
- Crypto is property. Selling, swapping one coin for another or spending it is a sale. A single person with $45,000 of wages who makes a $5,000 short-term crypto gain pays $600 (12%).
- Collectibles (art, coins, stamps, gold and silver, including many metal ETFs) are taxed at up to 28% when long-term.
- Small business stock (section 1202) can be partly or wholly tax-free if held long enough.
- Very large gains run into the 20% rate: a single person with $100,000 of wages and a $1 million gain pays $211,120 of federal tax on it, including $34,200 of NIIT.
State tax on gains
Most states tax capital gains as ordinary income at their normal rates, stacked on your other income. The calculator works out your state’s tax with and without the gain using its 2026 brackets: for a single person earning $60,000, a $30,000 gain adds about $2,485 of California tax, $1,627 in New York and $1,485 in Illinois. States with no income tax (Texas, Florida, Nevada and others) do not tax gains, with one exception: Washington taxes long-term gains on stocks and similar assets above a yearly standard deduction ($270,000 for 2024, raised for inflation) at 7%, and at 9.9% on gains over $1 million from 2025. Real estate is exempt there. Some states, such as Arkansas and Wisconsin, tax only part of long-term gains.
Ways to lower the tax
- Hold for more than a year to get the long-term rates.
- Harvest losses to offset gains, minding the wash-sale rule.
- Use the 0% band in low-income years, such as early retirement.
- Invest through a 401(k) or IRA, where gains are not taxed each year. The Roth IRA calculator shows tax-free growth.
- Give appreciated shares to charity instead of cash: no gain is taxed and you may deduct the full value.
- Spread a big sale across two tax years, or use an installment sale for property.
Reporting and paying
Sales are reported on Form 8949 and totaled on Schedule D of your Form 1040. Brokers send Form 1099-B; crypto platforms send Form 1099-DA from 2025 sales. Tax on a big gain is due during the year, so you may need an estimated payment for the quarter of the sale to avoid a penalty; the self-employment tax calculator lists the 2026 due dates. The federal income tax calculator puts gains together with the rest of your return.
Dividends and interest
Qualified dividends, paid by most US companies and many foreign ones on shares you have held for more than 60 days around the dividend date, get the same 0%, 15% and 20% rates as long-term gains. Ordinary dividends, such as those from REITs and money market funds, and interest from savings accounts, CDs and bonds are taxed as ordinary income. All of them count toward the 3.8% net investment income tax.
Funds and ETFs in a taxable account
Mutual funds must pass the gains they make on to shareholders, so you can owe tax in a year you sold nothing. ETFs usually pay out far fewer gains because of the way shares are created and redeemed. Index funds with low turnover are generally the most tax-efficient choice outside a retirement account. When you sell part of a holding, your broker uses first in, first out unless you choose specific lots, which can let you sell the shares with the highest cost first. The compound interest calculator shows how much tax drag on returns adds up over the years.
Common mistakes
- Selling a few days before the one-year mark and paying short-term rates.
- Forgetting reinvested dividends in the cost basis, which leads to paying tax twice on the same money.
- Leaving home improvements out of the basis when you sell a house.
- Buying back the same shares within 30 days of a loss sale (the wash-sale rule).
- Ignoring state tax, which can add 5% or more in many states.
- Not making an estimated payment after a large sale, which can bring an underpayment penalty.
Gifts and inheritances
Giving away an asset does not trigger capital gains tax, but the person who receives it usually takes over your cost basis and pays the tax when they sell. Inherited assets are treated differently: the basis steps up to the value on the date of death, so the gain built up during the owner’s lifetime is never taxed. That is why many people keep their most appreciated shares or property until death and give cash or high-basis assets during their lifetime. Inherited assets also count as long-term, however briefly the heir holds them.
