What Capital Gains Tax Is and How to Find Your Tax Rate
Capital gains tax is the tax you owe on profit when you sell an investment or property for more than you paid for it. The difference between what you paid (your cost basis) and what you sold it for (your sale price) is your gain. You only owe tax on that gain, not on the full sale price.
Your tax rate depends on how long you held the asset. If you owned it for one year or less, it counts as a short-term capital gain and is taxed at your ordinary income tax rate — the same rate as your salary or wages. If you owned it for more than one year, it counts as a long-term capital gain and gets a lower rate: 0%, 15%, or 20%, depending on your income level. The IRS publishes the income thresholds for each rate every year, and they change slightly.
You report capital gains on Schedule D (Form 1040) when you file your federal tax return. Some states also tax capital gains, though the rules vary by state.
Key Takeaways
- Capital gain equals sale price minus what you originally paid, and you only owe tax on that gain.
- Short-term gains (held one year or less) are taxed at your regular income tax rate; long-term gains (held over one year) get preferential rates of 0%, 15%, or 20%.
- You must know your cost basis — the original purchase price plus any improvements or reinvested dividends — to calculate your gain accurately.
- You report all capital gains on Schedule D and carry the total to your main tax return.
- Some states tax capital gains separately, so check your state's rules even if you owe nothing to the federal government.
Finding Your Cost Basis
Cost basis is what you paid for the asset, plus any costs directly tied to buying it. For a stock, it is the purchase price plus any broker fees. For real estate, it includes the purchase price, closing costs, and the cost of major improvements (a new roof, an addition, or a foundation repair). It does not include maintenance costs like painting or routine repairs.
If you inherited an asset, your cost basis is usually its fair market value on the date the person died, not what they originally paid. This is called a "step-up in basis" and can significantly lower your tax bill. If you received stock as compensation, your cost basis is the fair market value on the day you received it.
For mutual funds and ETFs, you can choose which shares you sold if you did not sell all of them at once. The most common method is "average cost," where you divide the total amount you invested by the total number of shares. Your brokerage statement usually shows your cost basis, but if it does not, you will need to gather your purchase confirmations and statements.
The Step-by-Step Calculation
Start with your sale price — the amount you actually received when you sold the asset. If you sold stock, this is the share price times the number of shares, minus any broker fees or commissions. If you sold a house, it is the sale price minus real estate agent commissions and closing costs you paid.
Next, subtract your cost basis from your sale price. The result is your capital gain (or loss, if the sale price was lower).
Then determine whether the gain is short-term or long-term by counting the holding period. The holding period starts the day after you buy and ends on the day you sell. If you bought on March 15 and sold on March 15 the next year, that is exactly one year, which qualifies as long-term. If you sold on March 14, it is short-term.
For short-term gains, your tax is the gain multiplied by your ordinary income tax bracket (10%, 12%, 22%, 24%, 32%, 35%, or 37%, depending on your income). For long-term gains, use the preferential rate (0%, 15%, or 20%) that matches your income level. The IRS website publishes the income thresholds each year.
Handling Multiple Sales and Losses
If you sold more than one asset in the same year, calculate the gain or loss for each one separately, then add them together. Short-term gains and losses go in one group; long-term gains and losses go in another.
Capital losses can offset capital gains. If you have a $5,000 long-term gain and a $3,000 long-term loss, your net long-term gain is $2,000. If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against your ordinary income. Any loss beyond that carries forward to future years.
This is why some people deliberately sell losing investments before the end of the year — a strategy called "tax-loss harvesting." You realize the loss on your tax return, which reduces your tax bill, while you can when ready buy a similar (but not identical) investment to stay in the market.
Special Situations: Real Estate and Inherited Assets
If you sold your primary home, you may not owe tax on the gain at all. The IRS lets you exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly, as long as you owned and lived in the home for at least two of the last five years.
If you inherited an asset, your cost basis resets to its value on the date of death. This means if someone bought a house for $100,000 and it was worth $400,000 when they died, your cost basis is $400,000. If you sell it a month later for $410,000, your gain is only $10,000, not $310,000. This step-up in basis applies to most inherited assets, including stocks, bonds, and real estate.
If you received an asset as a gift (not an inheritance), your cost basis is usually the giver's cost basis, not the gift's value at the time you received it. This can create a surprise tax bill if the asset has appreciated significantly since the original purchase.
State Capital Gains Taxes
Most states do not have a separate capital gains tax, but a few do. California, New Jersey, New York, Illinois, and Washington have capital gains taxes on top of federal tax. The rates and thresholds vary. Washington, for example, taxes long-term capital gains on stocks and certain other assets at a flat 7% rate if your gains exceed $250,000 in a year. New Jersey taxes capital gains as ordinary income.
If you live in a state with a capital gains tax, you will owe that tax in addition to federal tax. If you sold an asset in a state where you do not live, you may owe tax to both your home state and the state where the asset was located, though you can usually claim a credit for taxes paid to another state to avoid double taxation.
Records You Need to Keep
Keep your purchase confirmation, sale confirmation, and any statements showing cost basis for at least three years after you file your return. The IRS can audit you for up to three years for most returns, and longer if there is a substantial error.
For real estate, keep receipts for any improvements you made, because those add to your cost basis and reduce your taxable gain. For inherited assets, keep the death certificate and the appraisal or fair market value statement from the date of death. For mutual funds, keep statements showing dividend reinvestment, because reinvested dividends increase your cost basis.
If your brokerage provides a cost basis report, read and save it. Brokerages are required to track cost basis for securities bought after 2011, but the rules are complex and errors happen. Having your own records protects you if there is a discrepancy.
Frequently Asked Questions
Do I owe capital gains tax if I sold 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 of the excess against your ordinary income in that year, and carry any remaining loss forward to future years.
What if I do not know my cost basis?
Contact your brokerage or the company that held the asset. Brokerages are required to provide cost basis information for securities purchased after 2011. For older assets, you may need to search for old statements or confirmations. If you cannot find the records, the IRS allows you to estimate cost basis using the average price on the date you bought, though this is less reliable than actual records.
How do I report capital gains on my tax return?
Use Schedule D (Form 1040) to list each sale separately, showing the date bought, date sold, cost basis, sale price, and gain or loss. Add up all short-term gains and losses, then all long-term gains and losses. Carry the totals to your main return (Form 1040). If you have a net long-term gain, you may also need to fill out Form 8949 to show the details.
Can I avoid capital gains tax by donating the asset to charity?
Yes. If you donate appreciated stock or real estate 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 own the asset for more than one year for this to work. This is often more valuable than selling the asset and donating the proceeds.
What is the difference between realized and unrealized gains?
A realized gain is a gain you have actually sold and locked in — that is when you owe tax. An unrealized gain is profit on an asset you still own but have not sold. You do not owe tax on unrealized gains until you sell. This is why holding an appreciating stock does not trigger a tax bill; only the sale does.