MarklyFinance
    Taxes

    Capital Gains Tax: Everything You Need to Know

    Selling an investment for a profit triggers a capital gains tax — but how much you pay depends on how long you held it and your income. Here's everything you need to know to minimize it.

    James MitchellJames Mitchell · Updated 2026-08-28 · 10 min read
    Abstract financial growth chart in green over a dark navy background representing capital gains

    What Is Capital Gains Tax?

    A capital gain is the profit you make when you sell an asset — a stock, bond, real estate, or fund — for more than you paid for it. The IRS taxes that profit, and the rate you pay depends primarily on two things: how long you held the asset and your taxable income.

    Understanding capital gains tax is essential for any investor, because the difference between holding an asset for 11 months versus 13 months can change your tax rate by more than 10 percentage points. Strategic timing is one of the few legal, reliable ways to improve after-tax returns. For a long-term investor, the gap between a 15% long-term rate and a 32% short-term rate on a $50,000 gain is $8,500 — real money that compounds over a lifetime.

    Short-Term vs. Long-Term Gains

    The holding period is the single most important factor in capital gains taxation.

    • Short-term capital gains — assets held for one year or less are taxed at your ordinary income tax rate, which can be as high as 37% federally. This is the same rate you pay on wages.
    • Long-term capital gains — assets held for more than one year qualify for preferential rates of 0%, 15%, or 20%, depending on your income.

    The incentive is clear: the tax code rewards long-term investing. Holding an investment just past the one-year mark can cut your federal tax rate on the gain roughly in half — or more. The holding period clock starts the day after you buy and ends on the day you sell, so a position bought on March 1, 2025 becomes long-term on March 2, 2026.

    2026 Capital Gains Tax Rates

    Long-term capital gains use a three-tier bracket system tied to your taxable income. The thresholds are adjusted annually for inflation. For 2026, the long-term capital gains brackets are approximately:

    Tax Rate Single Filers Married Filing Jointly
    0% Up to ~$48,350 Up to ~$96,700
    15% $48,351 – $533,400 $96,701 – $600,050
    20% Over $533,400 Over $600,050

    A taxpayer in the 24% ordinary income bracket could pay just 15% on long-term gains — a meaningful advantage. Low-income investors may even pay 0% on long-term gains, a powerful opportunity for retirees and those in low-income years.

    Additionally, a 3.8% Net Investment Income Tax (NIIT) applies to high earners (over $200,000 single / $250,000 married), which effectively raises the top long-term rate to 23.8%.

    The 0% bracket opportunity

    The 0% long-term rate is one of the most underused tax breaks in the code. A married couple with taxable income under ~$96,700 pays zero federal tax on long-term gains. This creates opportunities for retirees (who may have low taxable income before RMDs begin), sabbatical years, and strategic "gain harvesting" — intentionally realizing gains in a low-income year to reset your cost basis at zero future tax cost.

    How Capital Gains Are Calculated

    Your capital gain is the sale price minus your cost basis (what you paid, plus any reinvested dividends and commissions). The formula:

    Capital Gain = Sale Price − Cost Basis

    For example, if you bought 100 shares at $50 ($5,000 basis) and sold them later at $80 ($8,000), your capital gain is $3,000. If held over a year, that gain is taxed at your long-term rate; if held a year or less, at your ordinary rate.

    Cost basis can get more complex with multiple purchases (you can use specific identification or average cost for mutual funds) and stock splits. Brokers are now required to report basis to the IRS, but keeping your own records — especially for older positions — protects you if records are lost.

    Use our capital gains tax calculator to estimate your liability based on your income and holding period.

    Strategies to Minimize Capital Gains Tax

    Several legal strategies can reduce or defer capital gains tax. The most impactful include:

    1. Hold investments for over a year

    The simplest and most reliable strategy. Whenever possible, wait until day 366 to sell qualifying positions. On a $100,000 gain for a 24%-bracket taxpayer, crossing the one-year threshold cuts the federal bill from $24,000 to $15,000 — a $9,000 saving for waiting a few weeks.

    2. Tax-loss harvesting

    Offset realized gains by selling investments at a loss. You can deduct up to $3,000 of net capital losses against ordinary income each year, with unused losses carrying forward indefinitely. Be careful to avoid wash-sale rules — you can't repurchase the same or a "substantially identical" security within 30 days.

    3. Use tax-advantaged accounts

    Gains inside a 401(k), Traditional IRA, or HSA are tax-deferred; gains in a Roth IRA are tax-free. Hold tax-inefficient, high-turnover investments in these accounts and tax-efficient index funds in taxable accounts.

    4. Gift appreciated stock

    Donating long-term appreciated stock to charity lets you deduct the full fair market value and avoid the capital gains tax entirely. Gifting to family in the 0% bracket can also shift the tax burden. Note that gifting to individuals uses your annual gift exclusion ($19,000 per recipient in 2026) before counting against your lifetime exemption.

    5. Time sales around income

    If you expect a low-income year — sabbatical, early retirement, or between jobs — realize long-term gains then to take advantage of the 0% bracket. See our tax planning guide for high earners for advanced timing strategies.

    6. The home sale exclusion

    For primary residences, up to $250,000 of gain ($500,000 married) is excluded from tax if you've lived in the home for at least 2 of the last 5 years — a major benefit for homeowners. This exclusion can be used repeatedly (though not more than once every two years), making it one of the most valuable tax breaks available to ordinary homeowners.

    Capital Gains on Real Estate and Other Assets

    Capital gains rules apply broadly, but with important variations. Investment real estate is subject to depreciation recapture (up to 25% on the portion of gain attributable to prior depreciation deductions), which can surprise investors who expect a flat 15% long-term rate. Collectibles (art, coins, precious metals) are taxed at a maximum 28% long-term rate, higher than the standard long-term brackets. Small-business stock under Section 1202 may qualify for partial or full exclusion of gains. These nuances make asset-specific planning essential for larger portfolios.

    State Capital Gains Taxes

    Most states tax capital gains as ordinary income, but a handful — including Texas, Florida, Washington, Nevada, Wyoming, South Dakota, Alaska, Tennessee, and New Hampshire — levy no state income tax at all, meaning your capital gains are taxed only at the federal level. California, by contrast, taxes capital gains at its top ordinary rate of over 13%, which can push a high earner's combined federal-plus-state long-term rate above 35%. This makes state of residence a meaningful factor in long-term tax planning, particularly for retirees and those considering relocation. Some states also offer their own exclusions or caps on capital gains, so check your state's rules before a major sale.

    Recordkeeping and Cost Basis

    Accurate cost-basis records are what make capital gains calculations defensible. Brokers are now required to report basis on most securities purchased after 2011, but for older positions, inherited assets, or reinvested dividends, you may need your own records. Keep purchase confirmations, reinvestment statements, and records of any stock splits or mergers. For inherited assets, the basis generally "steps up" to the fair market value at the date of death — a significant benefit that can eliminate years of accrued gain. Good recordkeeping turns a tax nightmare into a routine calculation, and it's far easier to maintain records as you go than to reconstruct them years later.

    Capital Gains Inside Retirement Accounts

    One of the most common points of confusion is how capital gains work inside tax-advantaged accounts. The short answer: they don't generate a capital gains tax at all while the money stays in the account.

    • Traditional 401(k) and IRA — all growth is tax-deferred. You can buy and sell freely inside the account with no tax consequence; taxes apply only when you withdraw, and withdrawals are taxed as ordinary income (not at preferential capital gains rates).
    • Roth IRA and Roth 401(k) — all growth is tax-free. Qualified withdrawals are entirely tax-free, so gains inside a Roth never face capital gains tax.
    • HSA — tax-free growth and tax-free qualified withdrawals for medical expenses, making it the most tax-efficient account available.

    This is why asset location matters: place tax-inefficient, high-turnover investments (active funds, REITs, taxable bonds) inside tax-advantaged accounts where their constant gains and distributions create no tax drag, and hold tax-efficient index funds in taxable accounts where their low turnover already minimizes tax. The same investments can produce very different after-tax returns depending on which account holds them.

    Inherited Assets and the Step-Up in Basis

    The step-up in basis is one of the most valuable — and least understood — tax provisions for families. When you inherit an asset, its cost basis is generally "stepped up" to the fair market value on the date of the original owner's death. Any gain that accrued during their lifetime is simply erased for tax purposes.

    Example: a parent bought stock for $20,000 that's worth $200,000 when they pass away. If they had sold it, they'd owe long-term capital gains tax on $180,000 of gain. Instead, you inherit it with a $200,000 basis — and if you sell it immediately, you owe essentially no capital gains tax. The entire $180,000 of lifetime gain vanishes from the tax system.

    This makes inherited appreciated assets fundamentally different from purchased ones, and it has major implications for estate planning. Holding highly appreciated, low-basis assets until death can be more tax-efficient than gifting them during life (which carries over the original low basis). For families with large unrealized gains, the step-up is often worth more than any other single tax provision.

    Capital Gains and Retirement Income

    For retirees, capital gains take on a different character. Many retirees live primarily on investment income, and the structure of that income determines their tax bill. Long-term capital gains and qualified dividends are taxed at the preferential 0/15/20% rates, while Traditional 401(k)/IRA withdrawals and short-term gains are taxed as ordinary income.

    This creates a powerful planning opportunity: a retiree whose income comes mostly from long-term gains may pay a far lower effective tax rate than one drawing from Traditional accounts. Combined with the 0% bracket, some retirees can generate substantial income at zero federal tax cost. Coordinating the sources of retirement income — Roth, taxable, and tax-deferred — to fill the 0% bracket each year is one of the highest-value moves in retirement tax planning.

    A Worked Example: Short-Term vs. Long-Term

    To see how much the holding period matters, consider an investor in the 24% federal bracket selling $50,000 of stock for a $30,000 gain.

    • Held 11 months (short-term): the $30,000 gain is taxed at the 24% ordinary rate, producing a federal tax bill of $7,200. Add a 5% state tax of $1,500, and the total is $8,700 — nearly 29% of the gain.
    • Held 13 months (long-term): the same $30,000 gain is taxed at the 15% long-term rate, producing a federal bill of $4,500. With the same 5% state tax of $1,500, the total is $6,000 — 20% of the gain.

    Waiting just two extra weeks (to cross the one-year mark) saves $2,700 on a single sale. Multiply that across a lifetime of sales, and the case for holding past one year is overwhelming — it is the single highest-ROI tax move available to most investors.

    Capital Gains vs. Ordinary Income: Why It Matters

    The preferential long-term rate exists because Congress wanted to reward long-term investment over short-term speculation. For an investor, this means your holding period is itself a tax strategy. A buy-and-hold investor who rarely sells pays capital gains tax only when they choose to realize gains — and can often defer those gains for decades, letting the money compound tax-deferred inside the position. In contrast, an active trader who turns over their portfolio yearly pays ordinary rates on every gain, dramatically reducing after-tax returns. This is a core reason index-fund investing is so tax-efficient: low turnover means few realized gains, and the gains that do occur are long-term.

    Planning Ahead: Year-End Tax Moves

    Capital gains planning is best done before December, not during the April scramble. Each fall, review your realized gains and losses for the year and consider: harvesting losses to offset gains, pushing planned sales into January to defer tax a year, bunching charitable gifts of appreciated stock, and checking whether your income places you near a bracket boundary where timing matters. A few hours of year-end planning can save thousands, and it's far easier to act in November than to fix things the following April.

    Expert Insight

    Tax-loss harvesting is one of the few 'free lunches' in investing, but it's often executed poorly. The wash-sale rule trips up many investors who auto-reinvest dividends or repurchase too quickly. I recommend using a different but similar fund (e.g., swapping one total-market index for another) to stay invested while the loss settles. Over a 30-year investing life, disciplined harvesting can add an estimated 0.5–1% per year in after-tax return — a meaningful edge.

    — James Mitchell, Senior Financial Analyst & Personal Finance Expert

    Key Takeaways

    • Short-term gains (held ≤1 year) are taxed at ordinary income rates up to 37%.
    • Long-term gains (held >1 year) qualify for preferential rates of 0%, 15%, or 20%.
    • High earners may also owe a 3.8% Net Investment Income Tax.
    • Tax-loss harvesting can offset gains and up to $3,000 of ordinary income yearly.
    • Hold tax-inefficient investments in tax-advantaged accounts.
    • Primary home sales can exclude up to $250K/$500K of gain.

    Frequently Asked Questions

    What is the difference between short-term and long-term capital gains tax?

    Short-term gains (assets held one year or less) are taxed at your ordinary income rate, up to 37%. Long-term gains (held more than one year) are taxed at preferential rates of 0%, 15%, or 20% based on income.

    How can I avoid paying capital gains tax?

    You can't eliminate it entirely, but you can reduce it by holding assets over a year, using tax-advantaged accounts, tax-loss harvesting, gifting appreciated stock, timing sales in low-income years, and using the home sale exclusion.

    What is tax-loss harvesting?

    Selling investments at a loss to offset capital gains. You can deduct up to $3,000 of net losses against ordinary income per year, with excess carrying forward. Avoid wash sales by not repurchasing the same security within 30 days.

    Do I pay capital gains tax if I reinvest the proceeds?

    Yes. Reinvesting the proceeds does not defer the tax — the gain is realized at the time of sale regardless of what you do with the money. Only reinvestments within tax-advantaged accounts avoid immediate taxation.

    What is the Net Investment Income Tax (NIIT)?

    The NIIT is a 3.8% surtax on investment income for taxpayers with modified AGI over $200,000 (single) or $250,000 (married). It effectively raises the top long-term capital gains rate to 23.8%.

    Do I owe capital gains tax if my income is low?

    Possibly not. If your taxable income falls within the 0% long-term capital gains bracket (up to roughly $48,350 single or $96,700 married in 2026), you pay zero federal tax on long-term gains. This creates opportunities to realize gains in low-income years, such as early retirement or a sabbatical, to reset your cost basis tax-free.

    What is depreciation recapture on real estate?

    When you sell investment real estate, the portion of your gain equal to the depreciation deductions you previously claimed is taxed at a maximum 25% recapture rate, rather than the standard long-term capital gains rate. It can significantly increase the tax bill on a rental property sale and is a key reason investors use 1031 exchanges to defer it.

    References & Further Reading

    Related Resources

    James Mitchell, Senior Financial Analyst & Personal Finance Expert

    Written by

    James Mitchell

    Senior Financial Analyst & Personal Finance Expert

    James Mitchell is a Certified Financial Planner with over 12 years of experience helping individuals and families achieve their financial goals. He specializes in retirement planning, investment strategies, and tax optimization. James holds an MBA in Finance from the University of Chicago and has been featured in major financial publications. His mission is to make complex financial concepts accessible to everyone.

    Certified Financial Planner (CFP) • MBA in Finance, University of Chicago Booth School of Business

    Related Articles

    Abstract financial chart in green over navy representing tax planning for high earners
    Taxes

    Tax Planning Strategies for High Earners

    High earners face the steepest tax bills — and the greatest opportunities to reduce them legally. Here are the most effective tax planning strategies for high-income professionals.

    2026-08-2811 min read