
If you sold stock, a rental property, or crypto this year, you need to understand how capital gains tax works before you file. It sounds complicated, but the math behind how capital gains tax works is actually pretty simple once you see it laid out with real numbers. This guide walks through the full example step by step, using the 2026 tax year brackets, so you can follow along with your own numbers.
At its core, how capital gains tax works comes down to one idea: you are taxed on the profit, not the full sale price, and how much you owe depends on how long you held the asset and how much you earn.
How Capital Gains Tax Works: The Short Version
Here is how capital gains tax works in one sentence: you subtract what you paid for an asset, plus certain costs, from what you sold it for, and that profit is your taxable gain. The tax rate applied to that gain depends on your holding period and your total taxable income for the year.
That is the whole engine. Everything else, brackets, holding periods, special exceptions, is just detail layered on top of that one calculation.
Short-Term vs Long-Term: How Capital Gains Tax Works Differently by Holding Period
This is the single biggest factor in how capital gains tax works for most people. The IRS splits gains into two categories based on how long you owned the asset before selling.
- Short-term gains. Assets held one year or less are taxed as ordinary income, at your regular tax bracket, which can run as high as 37 percent.
- Long-term gains. Assets held more than one year get preferential rates of 0 percent, 15 percent, or 20 percent, based on your taxable income.
That one year mark is the entire reason how capital gains taxes work so differently for a day trader versus a buy and hold investor. Waiting even one extra day past the anniversary of your purchase can change your rate dramatically.
2026 Capital Gains Tax Brackets: How Capital Gains Tax Works by Income
For the 2026 tax year, the long-term brackets are adjusted for inflation. Here is roughly where they land for single filers and married couples filing jointly:
| Rate | Single Filer Taxable Income | Married Filing Jointly |
|---|---|---|
| 0 percent | Up to about $49,450 | Up to about $98,900 |
| 15 percent | About $49,450 to $545,500 | About $98,900 to $613,700 |
| 20 percent | Over $545,500 | Over $613,700 |
These figures are inflation adjusted every year, so always confirm the current thresholds directly on the IRS Topic 409 page before you file, since I cannot guarantee these are the final published numbers for your specific filing situation. That said, this table shows exactly how capital gains tax works across income levels, most middle income sellers land in the 15 percent bracket, not the top rate people often assume.
Step by Step: How Capital Gains Tax Works in This Example
Let’s put real numbers behind how capital gains tax works, using a single filer with $90,000 in other taxable income who sells stock held for two years.
- Purchase price (cost basis): $8,000
- Sale price: $15,000
- Capital gain: $15,000 minus $8,000 equals $7,000
- Holding period: Two years, so this is a long-term gain
- Applicable rate: With $90,000 of other income plus a $7,000 gain, this filer sits in the 15 percent long-term bracket
- Tax owed: $7,000 multiplied by 15 percent equals $1,050
That $1,050 is the whole answer. Not $15,000 taxed, not the full sale price, just the $7,000 profit, taxed at the rate tied to this filer’s income and holding period. This is exactly how capital gains tax works in practice, and it is a lot less painful than most people expect when they picture the sale price and holding period colliding into one big tax bill.
Cost Basis and Deductions: How Capital Gains Tax Works Before You Owe Anything
Your cost basis is not always just the purchase price. It can include broker fees, closing costs on real estate, or reinvested dividends that already got taxed once. Understanding how capital gains tax works means getting this number right, because a higher cost basis means a smaller taxable gain. The IRS covers cost basis rules in detail in Publication 550.
You can also use realized losses on other investments to offset gains, a strategy known as tax loss harvesting. If you sold a losing stock the same year, that loss reduces the gain you owe tax on, which changes the entire calculation of how capital gains tax works for your return.
Special Cases: How Capital Gains Tax Works for Your Home or Dividends
A few situations change the standard rules. If you sold your primary home and lived in it at least two of the last five years, up to $250,000 of the gain, or $500,000 for married couples filing jointly, can be excluded entirely, as outlined in IRS Topic 701. Qualified dividends are also taxed at the same preferential long-term rates rather than as ordinary income.
Understanding how capital gains tax works for these edge cases can mean the difference between a tax bill and none at all, so it is worth double checking which category your sale falls into before you assume the standard rate applies.
Bottom Line
Now you know how capital gains tax works: figure out your gain, check your holding period, match it to your bracket, and multiply. If you want to run your own numbers the way we did in the example above, try our Capital Gains Tax Calculator to see your exact estimated bill before you file.
This is for informational purposes only and isn’t financial, tax, or legal advice.
Raghu Shekar writes about personal finance, banking, Medicare, and retirement planning at SimpleUSAFinance. His goal is simple: break down the numbers people actually need — no jargon, no sales pitch — so readers can make their own decisions with confidence. When he’s not writing, he’s usually digging through the latest rate changes, tax brackets, or Medicare updates to keep the site’s calculators and guides current.