Capital gains tax is a tax on the profit you make when you sell an asset for more than you paid for it
When you buy a stock, house, or piece of art and later sell it for a higher price, the difference between what you paid and what you received is a capital gain. The IRS taxes that profit. The tax rate depends on how long you held the asset and how much total income you earned that year. This is separate from income tax — it's not taxed as wages or salary, and it follows different rules.
The reason capital gains exist as a separate tax is historical: Congress wanted to encourage investment and long-term ownership. If you held an asset for more than a year before selling, you pay a lower rate (called the long-term rate). If you sold it within a year, you pay your ordinary income tax rate (called the short-term rate), which is usually higher. This structure rewards patience.
Not every sale triggers capital gains tax. If you sell something for less than you paid, you have a capital loss, which can reduce your taxable gains. If you sell your primary home and meet certain conditions — you owned it and lived in it for at least two of the last five years — you can exclude up to $250,000 of gain from tax (or $500,000 if married filing jointly). Inherited assets get a "step-up in basis," meaning the tax is calculated from the value on the date of death, not the original purchase price.
Key Takeaways
- Capital gains tax applies to the profit from selling an asset, not the full sale price, and is calculated separately from your regular income tax.
- Long-term capital gains (assets held over one year) are taxed at lower rates than short-term gains, which use your ordinary income tax bracket.
- The long-term capital gains rates are 0%, 15%, or 20%, depending on your total income; short-term gains are taxed at your full income tax rate (10% to 37%).
- You report capital gains on Schedule D (Form 1040) and must track your purchase price, sale price, and holding period for each asset.
- Losses from sales can offset gains dollar-for-dollar, and up to $3,000 of excess losses can reduce your ordinary income each year.
Long-term versus short-term: the holding period matters
The IRS draws a hard line at one year. If you own an asset for one year or less before selling it, any gain is a short-term capital gain and is taxed as ordinary income — at your regular tax bracket, which ranges from 10% to 37% depending on your income level. If you own it for more than one year, it becomes a long-term capital gain and qualifies for preferential rates.
Long-term capital gains rates are 0%, 15%, or 20%, and which rate you pay depends on your taxable income, not on how much the asset appreciated. For 2024, the 0% rate applies to single filers with taxable income up to $47,025 and married filers filing jointly up to $94,050. The 15% rate covers the middle range, and the 20% rate applies to higher earners. These income thresholds change each year with inflation.
The difference is substantial. Suppose you buy a stock for $10,000 and sell it for $15,000 nine months later. Your $5,000 gain is short-term. If you're in the 24% income tax bracket, you owe $1,200 in tax. If you had waited three more months and sold it as a long-term gain, and your income put you in the 15% long-term bracket, you'd owe $750 — a $450 difference on the same profit, just for waiting.
How the IRS calculates your capital gains tax
You report capital gains on Schedule D (Form 1040), which is filed with your annual tax return. For each asset you sold, you list the date you bought it, the date you sold it, your cost basis (what you paid, including commissions or fees), the sale price, and the gain or loss. The IRS uses this to sort your transactions into long-term and short-term piles.
Your cost basis is not always obvious. If you inherited stock, your basis is the value on the date of death, not what the original owner paid. If you received stock as compensation, your basis is the fair market value on the date you received it. If you bought mutual fund shares over time, you can choose which shares you're selling — "specific identification" — which lets you pick the batch with the lowest gain (or highest loss). Without specific identification, the IRS assumes you sold shares in the order you bought them (first-in, first-out).
Once you've calculated your total long-term gains and total short-term gains, they're stacked in a specific order on your tax return. Short-term gains are added to your ordinary income first, which can push you into a higher tax bracket. Long-term gains are then applied on top, and they're taxed at their preferential rates — but only to the extent they don't exceed the income thresholds for those rates. This layering can mean that some of your long-term gains are taxed at 15% and some at 20%, depending on your total income.
Capital losses and how they reduce your tax bill
If you sell an asset for less than you paid, you have a capital loss. Capital losses are powerful because they can offset capital gains dollar-for-dollar. If you had $8,000 in long-term gains and $3,000 in long-term losses, your net long-term gain is $5,000, and you're only taxed on that $5,000.
If your losses exceed your gains in a year, you can use the excess to reduce your ordinary income by up to $3,000 per year. If you have $10,000 in losses and $2,000 in gains, you have an $8,000 net loss. You can deduct $3,000 against your ordinary income that year, reducing your taxable income. The remaining $5,000 carries forward to future years and can be used the same way — $3,000 per year until it's exhausted.
This creates a tax-planning opportunity called "tax-loss harvesting." Investors sometimes sell losing positions late in the year to lock in losses, then buy a similar (but not identical) investment to maintain their market exposure. The IRS has a "wash-sale rule" that prevents you from buying the same or substantially identical security within 30 days before or after the sale, but the rule is narrow enough that strategic substitution is legal.
How capital gains fit into your overall tax picture
Capital gains don't exist in isolation. They interact with your income tax bracket, your filing status, and other income sources. Because long-term capital gains are taxed at preferential rates only within certain income thresholds, a large capital gain can push you into a higher bracket and cause some of your gain to be taxed at 20% instead of 15%.
Capital gains also affect other tax calculations. If your modified adjusted gross income (which includes capital gains) exceeds certain thresholds, you may owe the Net Investment Income Tax (NIIT), an additional 3.8% tax on investment income. For 2024, this applies to single filers with income over $200,000 and married filers over $250,000. Capital gains count toward this threshold.
If you receive Social Security benefits, capital gains can affect how much of your benefit is taxable. The IRS uses a formula that includes capital gains in "combined income," which determines whether your benefits cross the threshold for taxation. A large capital gain in a single year can unexpectedly increase your tax on Social Security.
Special situations: homes, inherited assets, and employee stock
The sale of your primary home is often tax-free. If you owned and lived in the home for at least two of the last five years before the sale, you can exclude up to $250,000 of gain from tax (or $500,000 if you're married filing jointly). This exclusion is available once every two years. If you sell for a gain larger than the exclusion, the excess is taxed as a long-term capital gain.
Inherited assets receive a "step-up in basis." If your parent bought a stock for $5,000 and it's worth $20,000 when they die, your basis becomes $20,000. If you sell it when ready for $20,000, you have no gain and owe no tax. This step-up applies to most inherited property, though there are exceptions for certain retirement accounts and some other assets. The step-up is one reason inherited assets are often more tax-efficient than appreciated assets you've held for decades.
Employee stock options and restricted stock units (RSUs) have their own rules. When an RSU vests, you have ordinary income equal to the fair market value on the vesting date. When you later sell the shares, any gain or loss from that vesting price is a capital gain or loss. If you exercise a non-may have access to stock option and sell the shares, the difference between the exercise price and the sale price is a capital gain (or loss). Incentive stock options have special rules that can allow for long-term capital gains treatment even if you haven't held the shares for a year, but only if you meet specific holding periods and exercise-price requirements.
Reporting capital gains on your tax return
You report capital gains on Schedule D (Form 1040), which is attached to your main tax return. If you have only a few transactions, the form is straightforward: list each sale, calculate the gain or loss, and total them. If you have many transactions — say, from a brokerage account with dozens of trades — your broker will send you a Form 1099-B showing all sales, and you can use that to fill in Schedule D.
Some brokers now provide "tax lot" information, which shows your cost basis for each share sold. If your broker doesn't, you'll need to track it yourself. Keeping records of purchase dates, purchase prices, and sale prices is essential. The IRS can ask for these records years later, and if you can't produce them, the agency can estimate your basis — usually unfavorably.
If your capital gains are large or complex, you may also need to file Form 8949 (Sales of Capital Assets), which feeds into Schedule D. Form 8949 is where you reconcile the information on your 1099-B with your own records, especially if your cost basis differs from what the broker reported.
Frequently Asked Questions
Do I owe capital gains tax if I haven't sold the asset yet?
No. Capital gains tax is only owed when you sell. If you own a stock that has doubled in value but you haven't sold it, there is no tax. The gain is "unrealized." You only owe tax when you realize the gain by selling the asset.
What if I sold an asset at a loss — can I deduct it?
Yes, but with limits. Capital losses offset capital gains first. If losses exceed gains, you can deduct up to $3,000 of the excess against ordinary income each year. Any remaining loss carries forward to future years and can be used the same way.
How do I know if my gain is long-term or short-term?
Count the days from the purchase date to the sale date. If it's more than one year, it's long-term. The IRS counts the purchase date as day zero and the sale date as day one, so buying on January 1 and selling on January 2 of the next year is long-term.
Can I avoid capital gains tax by donating appreciated assets to charity?
Yes. If you donate appreciated securities directly to a may have access to charity, you avoid the capital gains tax on the appreciation and can deduct the full fair market value as a charitable contribution. You must itemize deductions for this to benefit you.
What happens to capital gains tax when I die?
Your heirs receive a step-up in basis, meaning their cost basis becomes the fair market value on the date of your death. If they sell when ready, they owe no capital gains tax on the appreciation that occurred during your lifetime. The step-up applies to most assets but not to retirement accounts like IRAs or 401(k)s.