What capital gains tax means and how it works
Capital gains tax is a tax on the profit you make when you sell an asset for more than you paid for it. The tax applies to the difference between what you paid (your cost basis) and what you sold it for (your sale price). You only owe this tax if you actually sell the asset — simply owning something that goes up in value does not trigger the tax.
The federal government taxes capital gains, and most states do as well. The amount you owe depends on three things: how much profit you made, how long you held the asset, and your income level. The IRS treats long-term gains (assets held over one year) differently from short-term gains (assets held one year or less), and the difference can be substantial.
Key Takeaways
- Capital gains tax applies only to the profit on a sale, calculated as the sale price minus what you originally paid for the asset.
- Long-term capital gains (held over one year) are taxed at lower rates than short-term gains, which are taxed as ordinary income.
- Your cost basis includes the purchase price plus any improvements or fees, and you must track this information when you sell.
- You report capital gains on Schedule D (Form 1040) when you file your federal tax return, and most states require a separate state return as well.
The difference between long-term and short-term gains
The holding period determines which tax rate applies. If you own an asset for more than one year before selling it, any profit is a long-term capital gain. If you sell within one year, it is a short-term capital gain. This distinction matters because the tax rates are very different.
Short-term gains are taxed at your ordinary income tax rate — the same rate that applies to wages or salary. If you are in the 22% tax bracket, a short-term gain is taxed at 22%. Long-term gains have their own lower rates: 0%, 15%, or 20%, depending on your total income for the year. Most people pay 15% on long-term gains. The 0% rate applies only to people with very low income, and the 20% rate applies only to high-income earners.
Because of this difference, the timing of a sale can change your tax bill significantly. Selling an asset one month before the one-year mark can cost you thousands in extra taxes compared to waiting one more month.
How to calculate your cost basis
Cost basis is what you paid for the asset, and it is the foundation of the entire calculation. For most purchases, it is simply the price you paid. But basis can include other costs too: broker fees, commissions, title transfer fees, or the cost of improvements you made to the asset.
If you inherited an asset, your basis is usually the market value on the date the person died, not what they originally paid. This is called a "stepped-up basis" and can significantly reduce or eliminate the tax you owe. If you received an asset as a gift, your basis is generally the same as the giver's basis, which can be lower than the current market value.
For stocks and mutual funds, you must choose a method to track which shares you sold if you bought at different times and prices. The most common methods are "first in, first out" (FIFO), which assumes you sold the oldest shares first, or "specific identification," where you tell your broker exactly which shares to sell. Specific identification often results in lower taxes because you can choose to sell higher-cost shares first.
The step-by-step calculation
Start with the sale price — the amount you received when you sold the asset. Subtract your cost basis (what you paid plus any allowable costs). The result is your capital gain or loss.
| Step | Example |
| Sale price | $150,000 |
| Minus: Cost basis | $100,000 |
| Equals: Capital gain | $50,000 |
| Tax rate (long-term, 15%) | × 0.15 |
| Federal tax owed | $7,500 |
If you have a loss instead of a gain, you can use it to offset other capital gains. If your losses exceed your gains, you can deduct up to $3,000 of the loss against ordinary income in a single year. Any remaining loss carries forward to future years.
After you calculate your federal tax, you must also calculate state tax if your state has a capital gains tax. State rates vary widely — some states do not tax capital gains at all, while others tax them as ordinary income or at a flat rate. A few states have special capital gains taxes that apply only to high-income earners.
What you need to track and keep
The IRS does not require you to report a sale unless you have a gain, but you must be able to prove your cost basis if you are audited. Keep records of the original purchase price, the date you bought the asset, the date you sold it, the sale price, and any fees or improvements you added to the basis.
For real estate, keep receipts for major improvements like a new roof, addition, or renovation. Routine maintenance does not count as an improvement. For stocks and mutual funds, your broker will send you a Form 1099-B showing the proceeds from the sale, but it may not show your cost basis accurately — you are responsible for providing the correct basis to the IRS.
If you sold an asset at a loss, keep those records too. You will need them to report the loss on your tax return and to carry forward any unused losses to future years.
Where to report capital gains on your tax return
You report capital gains on Schedule D (Form 1040), which is part of your federal tax return. Schedule D asks you to list each sale separately, showing the date acquired, date sold, cost basis, sale price, and gain or loss. You then transfer the total to your main tax return.
If you have only one or two simple sales with long-term gains and no losses, you may be able to report them on a simpler form, but most people use Schedule D. Your tax software will usually walk you through the process if you provide the sale information.
Most states require you to report capital gains on your state tax return as well. Some states use a separate schedule similar to Schedule D, while others ask for the information on the main state return. Check your state's tax authority website for the specific form and instructions.
Special situations and exceptions
If you sold your primary home, you may be able to exclude up to $250,000 of the gain from federal tax (or $500,000 if you are married filing jointly). To may have access to, you must have owned and lived in the home for at least two of the last five years. This exclusion applies only once every two years.
If you sold a business or investment property, different rules may apply. Some assets may have access to for preferential treatment, such as certain small business stock or collectibles. Collectibles are taxed at a maximum rate of 28%, which is higher than the standard long-term rate but lower than short-term rates for high-income earners.
If you have investment losses that exceed your gains, you can carry forward unused losses indefinitely. This means if you lose $10,000 in one year and only gain $7,000, you can use the remaining $3,000 loss against income in the current year and carry forward $0 to future years (since the $3,000 limit applies per year). The unused portion carries to the next year.
Frequently Asked Questions
Do I owe capital gains tax if I sell at a loss?
No, you do not owe tax on a loss. Instead, you can use the loss to offset capital gains from other sales. If your losses exceed your gains, you can deduct up to $3,000 against ordinary income in that year, and carry forward any remaining loss to future years.
What if I do not know my original purchase price?
Contact the seller, your broker, or the company that issued the asset. For stocks, your broker has records going back many years. If you genuinely cannot find the information, the IRS may allow you to use a reasonable estimate, but this is risky in an audit. Document your effort to find the actual price.
How do I know if my state taxes capital gains?
Check your state's tax authority website or ask a tax professional. Nine states have no income tax at all, so they do not tax capital gains. Others tax capital gains as ordinary income, while a few have special capital gains taxes. The rate varies by state and sometimes by income level.
Can I reduce my capital gains tax by donating the asset to charity instead of selling it?
Yes. If you donate an appreciated asset directly to a may have access to charity, you avoid the capital gains tax entirely and can deduct the fair market value of the asset. This works only if you donate the asset itself, not the proceeds from a sale. Consult a tax professional to make sure the charity qualifies.
What happens if I inherit an asset that has gone up in value since the original owner bought it?
Your cost basis is the market value on the date of death, not what the original owner paid. This stepped-up basis means you owe no tax on the increase that occurred during their lifetime. You only owe tax on any gain that occurs after you inherit it.