Capital gains tax is the tax you pay on the profit from selling an investment or other capital asset. It applies to stocks, bonds, mutual funds, ETFs, real estate, cryptocurrency, and collectibles. The amount you owe depends on how long you held the asset, your taxable income, your filing status, and where you live. Understanding the rules can help you keep more of your gains and avoid costly mistakes.
What Is Capital Gains Tax?
A capital gain is the difference between what you sell an asset for and its adjusted cost basis. Basis generally includes the purchase price plus commissions, certain fees, and improvements for real estate. If you sell for less than your basis, you have a capital loss. Losses can offset capital gains, and up to $3,000 of net capital losses can offset ordinary income each year; excess losses carry forward to future years.
Not every asset sale creates a capital gain. Inventory held for sale to customers, certain business property, and some hedges are not treated as capital assets. Special rules also apply to inherited assets, gifts, and your primary home.
Key points:
- Capital gains tax is triggered when you sell, exchange, or otherwise dispose of a capital asset.
- The tax is not withheld automatically in a taxable brokerage account; you report it on your tax return.
- Inherited assets generally receive a step-up in basis to fair market value as of the date of death, which can eliminate tax on appreciation during the decedent's lifetime.
- Gifts generally carry over the donor's basis, so the recipient may owe tax on gains when they sell.
Short-Term vs. Long-Term Capital Gains: The Holding Period Matters
The holding period is the single biggest factor in how your gain is taxed.
- Short-term capital gains: assets held one year or less. These are taxed as ordinary income at rates from 10% to 37% for 2025.
- Long-term capital gains: assets held more than one year. These qualify for preferential federal rates of 0%, 15%, or 20%, depending on taxable income.
The holding period starts the day after you acquire the asset and ends on the day you sell it. For example, if you buy a stock on January 10, 2024, and sell it on January 11, 2025, the gain is long-term. Sell on January 10, 2025, and it is short-term because you held it for exactly one year, not more than one year.
2025 Capital Gains Tax Rates and Brackets
Long-term capital gains rates are based on taxable income, not gross income. For the 2025 tax year, the thresholds are:
- 0% rate: taxable income up to $48,350 for single filers; up to $96,700 for married filing jointly.
- 15% rate: $48,351 to $533,400 for single filers; $96,701 to $600,050 for married filing jointly.
- 20% rate: above $533,400 for single filers; above $600,050 for married filing jointly.
These inflation-adjusted thresholds come from IRS Revenue Procedure 2024-40. Short-term gains are stacked on top of your ordinary income and taxed at your marginal ordinary rate, which can be as high as 37%.
The 3.8% Net Investment Income Tax
High-income taxpayers may owe an additional 3.8% Net Investment Income Tax, or NIIT. It applies to the lesser of your net investment income or the amount your modified adjusted gross income exceeds these thresholds:
- $200,000 for single filers
- $250,000 for married filing jointly
- $125,000 for married filing separately
Net investment income includes capital gains, dividends, interest, and rental income. The NIIT can raise the top federal rate on long-term capital gains to 23.8% and on short-term gains to 40.8%.
How to Calculate Capital Gains Tax on an Investment
Follow these steps:
- Determine your proceeds: the sale price minus selling commissions and fees.
- Determine your adjusted basis: the purchase price plus purchase commissions, fees, and qualifying improvements.
- Subtract basis from proceeds to find the gain or loss.
- Determine your holding period.
- Apply the correct federal rate, then add any state tax and the NIIT if applicable.
Example: You buy 100 shares at $50 per share and pay a $10 commission. Your basis is $5,010. You later sell at $80 per share and pay a $10 commission, so proceeds are $7,990. Your gain is $2,980. If it is long-term and you are in the 15% bracket, federal tax is $447. If it is short-term and you are in the 24% bracket, federal tax is $715.20. State tax may add more.
Legitimate Ways to Reduce Capital Gains Tax
- Hold investments for more than one year when possible. The difference between short-term and long-term rates can be substantial.
- Use tax-advantaged accounts. Sales inside a 401(k), traditional IRA, Roth IRA, or HSA do not trigger capital gains tax. Withdrawals are taxed according to the account's rules.
- Harvest tax losses. Selling a losing investment can offset realized gains. The wash-sale rule disallows the loss if you buy a substantially identical security within 30 days before or after the sale.
- Give appreciated stock to charity. Donating long-term appreciated securities to a qualified charity or donor-advised fund can provide a deduction at fair market value and avoid capital gains tax on the appreciation.
- Use the 0% bracket strategically. If your taxable income is low, you may pay 0% on some long-term gains. Be aware of the kiddie tax if you gift assets to children.
- Consider deferral strategies. Like-kind exchanges under Section 1031 for certain real estate and qualified opportunity zone investments can defer gains, but the rules are complex.
- Plan for step-up in basis. Assets held until death generally pass to heirs with a stepped-up basis, potentially eliminating capital gains tax on prior appreciation.
State Capital Gains Taxes
Most states tax capital gains as ordinary income, so your state rate may be the same as your income tax rate. Rates range from 0% in states such as Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming to more than 13% in California. Washington is a special case: it has no personal income tax but imposes a 7% excise tax on certain long-term capital gains above an inflation-adjusted threshold. Some states offer preferential rates for long-term gains, so check your state's rules.
Bottom Line
Capital gains tax is not one flat rate. Your holding period, taxable income, filing status, and state of residence determine what you owe. Long-term gains receive preferential federal rates, and the 3.8% NIIT can apply at higher income levels. Strategies such as holding longer than one year, tax-loss harvesting, charitable giving, and maxing out tax-advantaged accounts can reduce your bill. Keep careful records of basis and holding periods, and consult a tax professional for complex transactions.