Capital gains tax sounds like one of those “grown-up finance” topics you are supposed to understand automatically. In real life, it is simpler than it feels: if you sell something for more than you paid, the profit is a capital gain, and the IRS may want a cut.
The two big levers are how long you owned the asset (short-term vs long-term) and your income. Once you see those pieces, you can usually estimate your federal tax bill before you ever hit “sell.”

What counts as a capital gain?
A capital gain is the profit from selling a capital asset. Common examples include:
- Stocks, ETFs, mutual funds
- Cryptocurrency
- Real estate (a rental property, land, sometimes your home)
- Small business interests (selling shares or part of a company)
- Collectibles like certain coins, art, or sports memorabilia
If you sell for less than you paid, that is a capital loss, which can offset gains (and potentially reduce other income, within limits).
Quick vocabulary that makes the rest easier
- Cost basis: Usually what you paid, plus certain costs. For shares, basis can be adjusted for reinvested dividends, corporate actions, wash sales, and some fund distributions (for example, return of capital).
- Proceeds: What you received when you sold (net of certain fees).
- Realized gain: The gain becomes real for tax purposes when you sell.
- Unrealized gain: Your investment is up, but you have not sold yet, so there is typically no capital gains tax due yet.
When do you owe capital gains tax?
Most investors owe capital gains tax when all three are true:
- You sold a capital asset (or it was otherwise disposed of).
- You sold it for more than your adjusted cost basis.
- The gain is not excluded by a special rule (more on exceptions below).
In a taxable brokerage account, a stock that rises in value does not create a tax bill until you sell it. That is why holding and compounding can be so powerful.
One surprise to watch for: certain investments (especially mutual funds) can pass through capital gain distributions, which can be taxable even if you did not sell your shares.
What about retirement accounts?
If you buy and sell inside a traditional IRA, Roth IRA , or most 401(k) plans, you generally do not pay capital gains taxes each time you trade. Taxes happen under the retirement account rules instead (for example, withdrawals from a traditional IRA are typically taxed as ordinary income, while qualified Roth withdrawals are generally tax-free).
Short-term vs long-term capital gains
This is the heart of it.
Short-term capital gains
If you hold an asset for one year or less before selling, your gain is typically short-term. Short-term gains are taxed at ordinary income tax rates, the same rates that apply to wages and most business income.
Long-term capital gains
If you hold an asset for more than one year before selling, your gain is typically long-term. Long-term gains often get preferential federal tax rates: 0%, 15%, or 20%, depending on your income. Some long-term gains have special maximum rates (for example, certain collectibles and some real-estate-related gains), so do not assume every long-term gain fits neatly into the 0% to 20% buckets.
The one-year rule, in human terms
The IRS does not mean “a calendar year.” It means you need to hold longer than 12 months. If you bought on June 10, 2025, selling on June 10, 2026 is generally not long-term. Selling on June 11, 2026 generally is.

Current federal long-term capital gains brackets
For many assets, long-term capital gains fall into one of three federal buckets: 0%, 15%, or 20%. Your bracket depends on your taxable income and filing status.
Important: The IRS updates thresholds over time. Always confirm the current year’s brackets on IRS.gov or with your tax pro before making a major sale.
Also important: Not all long-term gains use those same brackets. Two common examples are:
- Collectibles: Some may be taxed at a higher maximum federal rate than typical long-term capital gains.
- Certain real estate gains: Some gains tied to depreciation can be taxed at a different maximum rate than standard long-term capital gains.
Short-term rates are your regular income rates
Short-term gains are taxed like ordinary income, which means your top marginal rate could be higher than long-term rates. That is why two people can have the same $5,000 gain and very different tax outcomes.
Net Investment Income Tax may apply
Higher-income households may owe an additional 3.8% tax on certain investment income, including capital gains. This is generally based on your modified adjusted gross income (MAGI) above certain thresholds, which vary by filing status and can change over time. If you think you might be in range, it is worth running the numbers before a large sale.
Simple examples
Let’s make this concrete with straightforward scenarios. (These are simplified examples and ignore state taxes, potential NIIT, wash sale rules, and other nuances.)
Example 1: You sell after 6 months
You buy 100 shares at $50. Total cost basis: $5,000. Six months later, you sell for $65. Proceeds: $6,500.
- Gain: $6,500 minus $5,000 = $1,500
- Tax treatment: Short-term capital gain
- What you owe: $1,500 taxed at your ordinary income rate
Example 2: You sell after 18 months
Same buy: $5,000 basis. Eighteen months later, you sell for $6,500.
- Gain: $1,500
- Tax treatment: Long-term capital gain
- What you owe: $1,500 taxed at 0%, 15%, or 20% depending on income (plus any applicable surtaxes)
Example 3: You sell at a loss
You buy 100 shares at $50 (basis: $5,000) and sell 100 shares at $40 (proceeds: $4,000).
- Loss: $4,000 proceeds minus $5,000 basis = -$1,000
- Tax treatment: Capital loss
- What it can do: Offset capital gains. If losses exceed gains, you can generally deduct up to $3,000 per year against ordinary income ($1,500 if married filing separately), with the remainder carried forward.
Example 4: You reinvest dividends, then sell
Dividend reinvestment often increases your cost basis over time, because each reinvested dividend typically buys more shares with its own basis. That can reduce your taxable gain when you finally sell, but only if your records are correct. Broker cost basis reporting helps, but it is still smart to understand what is happening.

Common exceptions
Capital gains taxes have a few “big” carve-outs that show up often for households and business owners.
Primary home sale exclusion
If you sell your primary residence, you may be able to exclude up to:
- $250,000 of gain if you file single
- $500,000 of gain if you file married filing jointly
In general, you must meet ownership and use requirements, commonly described as living in the home for at least two of the last five years before the sale. Also, you can generally only claim this exclusion once every two years. There are additional details and partial exclusions for certain life events, so confirm your specifics if you are close to the line.
Collectibles can be taxed differently
Some collectibles may face a higher maximum federal rate than typical long-term capital gains. If you are selling art, rare coins, or similar items, do not assume the 0% to 20% framework applies the same way.
Business and startup equity sales
Founders and early employees can face unique rules, depending on whether you are selling:
- Public shares
- Private company shares
- Options (ISOs or NSOs)
- Qualified Small Business Stock (QSBS), if applicable
These scenarios can be incredibly tax-sensitive. If your sale could be life-changing, it is worth paying for tax advice before you sign paperwork.
Gifts and inheritances
Two quick notes that prevent a lot of confusion:
- Gifting: The recipient often takes on the giver’s cost basis (with important nuances).
- Inheritance: Many inherited assets receive a “step-up” (or step-down) in basis to the value around the date of death, which can reduce taxable gains for heirs when they sell.
Do states tax capital gains?
Many states tax capital gains, often at the same rate as ordinary income. A few states have no state income tax. Because state rules vary, your true “all-in” capital gains cost can differ dramatically depending on where you live.
If you are planning a large liquidity event, this is one of those moments where location and timing can matter.
Tax-time checklist
When you sell investments in a taxable account, tax prep is mostly about having the right forms and confirming the numbers match your reality.
- Form 1099-B from your broker (sales proceeds, cost basis reporting, holding period classification)
- Form 1099-DIV (dividends and capital gain distributions from funds)
- Form 1099-INT (interest, if applicable)
- Year-end brokerage statements (helpful for cross-checking)
- Cost basis support for anything not fully covered by your broker, such as older shares, transferred accounts, or certain alternative assets
- Records of reinvested dividends if basis is unclear
- Home sale documents if you sold a primary residence, including closing statements and records of major improvements
- K-1s if you have partnerships, certain funds, or private investments
If you are DIY-ing your taxes, your software will typically populate Schedule D and Form 8949 using the 1099-B. If you use a CPA, the cleaner your records, the fewer billable hours you will buy.
Ways to reduce capital gains taxes
I am not a fan of gimmicks, but there are a few time-tested strategies that can help:
- Hold investments longer than one year to qualify for long-term rates.
- Use tax-advantaged accounts (401(k), IRA, Roth IRA, HSA where appropriate) for active trading or high-growth assets.
- Tax-loss harvest by realizing losses to offset gains, while respecting wash sale rules.
- Be intentional about timing, especially near year-end or in a year your income is temporarily lower.
- Donate appreciated assets (when it fits your philanthropic goals). In many cases, you can avoid realizing the gain and potentially take a deduction.
The right choice depends on your full picture: income, business cash flow, upcoming purchases, and risk tolerance. Taxes are a factor, not the only factor.
FAQ
Do I pay capital gains tax if I do not withdraw cash from my brokerage?
Yes. In a taxable brokerage account, the tax trigger is usually the sale, not whether you moved money to your bank.
What about mutual funds that I did not sell?
Mutual funds can distribute capital gains to shareholders, which can create a tax bill even if you did not sell your fund shares. Your Form 1099-DIV typically reports this.
How do I know if my gain is short-term or long-term?
Your broker will typically flag the holding period on your 1099-B. Still, it is wise to understand the purchase date and sale date yourself, especially if you traded around the one-year mark.
If I sell and immediately buy back, is the gain avoided?
No. Selling generally realizes the gain. Buying back resets your cost basis and holding period. Separate from that, selling at a loss and rebuying can run into wash sale issues.
Keep learning
If this topic sparked more questions, you are not alone. Capital gains tax sits right at the intersection of investing, income planning, and good recordkeeping.
- Investing Basics
- Brokerage Account vs IRA: What Taxes Change
- Tax-Loss Harvesting Explained
- Dividends Explained: How You Get Paid
Friendly reminder: Tax rules change, and your situation matters. If you are dealing with a home sale, a business sale, equity compensation, real estate depreciation, or a very large gain, consider getting personalized guidance from a CPA or enrolled agent.