How Does Capital Gains Tax Work?

How Does Capital Gains Tax Work
Written by
Uploaded on
Share

If you sell stocks, property, or other assets for a profit, capital gains tax is the tax on that gain, not the full sale price. It depends on your cost basis, holding period, income level, and any losses or exclusions you can use. Knowing the rules can help you reduce capital gains tax without guesswork or last-minute stress. 

In this blog, we will explain how capital gains tax works, what rates apply, and the simple steps that can help you keep more of your money and plan smarter before selling.

Key Takeaways

  • Long-term gains (held over one year) are taxed at 0%, 15%, or 20%, based on income.
  • Short-term gains (held one year or less) are taxed as ordinary income, up to 37%.
  • A single filer owes 0% tax if taxable income is $48,350 or less for 2025.
  • Selling a primary home can exclude up to $250,000 of gain ($500,000 joint) from tax.
  • High earners may owe an extra 3.8% Net Investment Income Tax on top of the capital gains rate.
  • Every sale gets reported on Form 8949, then totaled on Schedule D.

What Is Capital Gains Tax?

Capital gains tax applies to the profit from selling an asset, not the full sale price. The IRS taxes the gap between your cost basis (what you paid) and what you sold it for.

Example: Buy 100 shares for $2,000, sell them for $5,000, and your taxable gain is $3,000, not $5,000.

The IRS treats almost anything you own for personal or investment use as a capital asset: home, car, stocks, crypto, collectibles. Sell for more than you paid, and you owe tax on a gain. Sell for less, and you have a deductible loss.

How Does Capital Gains Tax Work Under IRS Rules?

If you hold an asset one year or less, the IRS taxes the profit at your ordinary income rate. If you hold it more than one year, the profit gets the flat 0%, 15%, or 20% rate instead.

If you sell at day 364, you pay ordinary rates. If you wait two more days, per IRS Topic No. 409, the gain could drop to the 15% bracket, worth $1,800 or more on a $20,000 gain for someone in the 24% bracket.

The IRS counts the holding period from the day after purchase through the day of sale. Miss one year by a single day, and the entire gain stays short-term.

How Does Capital Gains Tax Work Under IRS Rules?

The 5 Factors That Determine Your Capital Gains Tax Bill

Five inputs set your final capital gains tax bill: purchase price, sale price, holding period, available losses, and your overall tax situation.

1. Purchase Price (Cost Basis)

Cost basis is what you paid for an asset, plus qualifying fees and improvements. For stocks, that’s the purchase price plus commissions; for real estate, add closing costs and major upgrades like a new roof.

Inherited property usually gets a stepped-up basis at fair market value on the date of death, per Publication 551, wiping out years of paper gains. Gifted property keeps the giver’s original basis instead. A higher basis means a smaller taxable gain later, which is why saving improvement receipts pays off at tax time.

2. Selling Price

Selling price, or “amount realized,” is what you actually keep after selling costs, not the sticker price. A home selling for $500,000 with $30,000 in commissions and closing costs has an amount realized of $470,000.

3. Holding Period

Holding period decides short-term versus long-term treatment. The IRS counts from the day after purchase through the sale date, per Topic No. 409. Inherited assets automatically get long-term treatment, regardless of how briefly the heir held them.

4. Capital Losses

Capital losses offset capital gains dollar for dollar. If losses exceed gains, you can deduct up to $3,000 of the excess against ordinary income each year ($1,500 if married filing separately), per Topic No. 409. Selling a losing position the same year as a winning one cancels out part or all of that gain.

5. Your Tax Situation

Your filing status and total taxable income decide which rate bracket your gain falls into. The identical $50,000 gain can be taxed at 0% for one taxpayer and 15% for another, based purely on other income that year.

How Capital Gains Are Actually Calculated (Step-by-Step)

Calculating a gain follows one sequence: find basis, find amount realized, subtract the two, then classify by holding period. Every capital gains tax calculator, including Form 8949 itself, runs on this logic.

  1. Find adjusted basis. Purchase price plus qualifying costs, minus depreciation already claimed on rental property.
  2. Find amount realized. Sale price minus selling costs like commissions and transfer taxes.
  3. Subtract. Amount realized minus basis. Positive is a gain, negative is a loss.
  4. Classify it. Over one year is long-term. One year or less is short-term.
Example: Maria bought a rental duplex for $220,000 in 2023, spent $15,000 on a new roof, bringing her basis to $235,000. She sold it in 2025 for $310,000, paying $18,000 in selling costs, for an amount realized of $292,000. Her gain is $57,000, and since she held it over a year, it’s long-term.

A real estate capital gains tax calculator is worth running before listing a rental, since depreciation recapture adds a layer most basic tools handle automatically.

Short-Term vs. Long-Term Capital Gains Tax Rates

Short-term gains are taxed at your ordinary income rate, up to 37%. Long-term gains are taxed at 0%, 15%, or 20%, per current IRS Topic No. 409 figures.

The below table shows the 2025 long-term capital gains brackets, which apply to returns filed in 2026.

Filing Status 0% Rate 15% Rate 20% Rate
Single Up to $48,350 $48,351–$533,400 Over $533,400
Married Filing Jointly Up to $96,700 $96,701–$600,050 Over $600,050
Married Filing Separately Up to $48,350 $48,351–$300,000 Over $300,000
Head of Household Up to $64,750 $64,751–$566,700 Over $566,700

A few assets break this pattern: collectibles and Section 1202 qualified small business stock cap at 28%, and unrecaptured Section 1250 real estate gain caps at 25%. Short-term gains skip all of this and stack on top of wages at your regular bracket.

Which Assets Are Subject to Capital Gains Tax?

Nearly everything you own for personal or investment use triggers capital gains tax when sold for a profit, per Topic No. 409.

  • Stocks, bonds, mutual funds: Standard short-term or long-term rules apply.
  • Real estate: Investment property follows standard rules; primary homes get a special exclusion.
  • Cryptocurrency: The IRS treats crypto as property, so every sale or trade is taxable.
  • Collectibles: Coins, art, and wine cap at a 28% long-term rate regardless of income.
  • Business interests: Selling shares in a partnership or S corp triggers capital gains rules with added basis complexity.
  • Personal-use property: Cars and furniture can generate a taxable gain, but losses on them aren’t deductible.

Assets inside a 401(k), traditional IRA, or Roth IRA escape capital gains tax while held in the account. Traditional withdrawals get taxed as ordinary income instead; qualified Roth withdrawals aren’t taxed at all.

When You May Not Owe Capital Gains Tax

You may owe nothing if your taxable income sits below the 0% threshold, if you qualify for the home sale exclusion, or if losses fully cancel your gains for the year.

Primary Residence Exclusion Rules

Qualifying home sellers can exclude up to $250,000 of gain ($500,000 married filing jointly) entirely, per Publication 523 and Topic No. 701. You generally need to have owned and lived in the home for at least two of the five years before the sale, and you can only claim it once every two years.

Capital Losses and Tax Offsets

Losses cancel gains dollar for dollar before any rate applies. $10,000 in gains against $10,000 in losses nets to zero taxable gain.

This is the basis of tax-loss harvesting: selling underperforming positions on purpose to offset gains elsewhere. You must report capital losses to offset gains on the same Form 8949 and Schedule D used for gains; it isn’t automatic. Losses offset same-type gains first, short-term against short-term and long-term against long-term, before crossing categories.

How the IRS Tracks and Taxes Capital Gains

The IRS tracks gains mainly through Form 1099-B, which brokers and closing agents file reporting your proceeds and, usually, your basis. That data gets matched against your own return.

Every sale goes on Form 8949, split into short-term and long-term sections, then totals flow to Schedule D, which sets your net gain or loss. That figure moves to Form 1040 and combines with your other income.

Large gains can trigger quarterly estimated payments under Publication 505; waiting until April risks a penalty even if you pay in full by the deadline.

High earners face one more layer: the 3.8% Net Investment Income Tax, which applies once MAGI exceeds $200,000 single or $250,000 married filing jointly, per Topic No. 559. A single filer with $250,000 MAGI and a $100,000 gain owes NIIT on the $50,000 excess over the threshold, an extra $1,900.

Common Capital Gains Tax Mistakes Taxpayers Make

  • Underreporting basis: Forgetting reinvested dividends or improvement costs inflates the gain.
  • Selling one day too early: Missing the one-year mark pushes the whole gain into ordinary rates.
  • Ignoring state tax: California capital gains tax brackets tax gains as ordinary income up to 13.3%, with no separate long-term rate.
  • Losing carryover losses: Unused losses above $3,000 a year carry forward indefinitely, but only if tracked on next year’s return.
  • Missing estimated payments: A large mid-year gain without an adjusted payment can trigger penalties.

A mistake we see often in our practice: business owners selling appreciated assets through an S corp without reviewing capital gains tax planning with an S corp first, since gains pass through to shareholders in ways that surprise owners at filing time.

How Hopkins CPA Can Help With Capital Gains Tax Planning

Hopkins CPA Firm plans capital gains exposure before a sale closes, which is when the real savings exist. Our team includes former IRS agents, former IRS revenue officers, and licensed tax attorneys carrying over 150 years of combined IRS-side experience.

We review your basis documentation, holding periods, and available losses to build a sale strategy, then handle the Form 8949 and Schedule D reporting so nothing gets mismatched against IRS records. For business owners and investors, we also evaluate installment sales, 1031 exchanges, and entity structuring to legally reduce capital gains tax.

We’ve resolved over 10,000 IRS cases across all 50 states, and our founder & team brings 30+ years as a licensed CPA and former corporate CFO to every conversation. Book a consultation with us before you sign anything on a sale.

Steps to Take Before Selling an Asset With Significant Gains

  1. Run the numbers first. Use a capital gains tax calculator to estimate federal, state, and NIIT exposure before committing.
  2. Check your holding period exactly. A few days near the one-year mark can change your rate entirely.
  3. Inventory your losses. Underperforming positions sold the same year can offset the gain.
  4. Confirm exclusions. For a home sale, verify the two-of-five-year test under Publication 523.
  5. Plan for estimated taxes. Set aside funds to avoid a Publication 505 underpayment penalty.

The Bottom Line Before You Sell

The math behind how capital gains tax works stays consistent: basis, sale price, holding period, and income bracket set the bill, while losses and exclusions like the home sale rule shrink or erase it. The real savings come from decisions made before the sale, not at filing season.

Hopkins CPA Firm built its practice on that kind of forward planning. Whether the asset is stock, a rental, or a business interest, we map the tax impact before you sign anything. If a sale is on your calendar this year, talk to us first. Contact Hopkins CPA Firm and know your real number going in.

FAQs

Yes, reinvesting doesn't avoid the tax; it applies the moment you sell, regardless of what happens to the proceeds.

0%, 15%, or 20% if held over a year, or your ordinary income rate if held a year or less.

Yes, losses offset gains dollar for dollar, and up to $3,000 of excess losses reduce ordinary income each year.

Yes, retirees pay the same rates as anyone else; retirement status alone creates no exemption.

Report each sale on Form 8949, carry totals to Schedule D, which flows into total tax on Form 1040.

Table of Contents

Form Title
To tackle your IRS Notice smartly.
Author

Joe has 30+ years as a Certified Public Accountant licensed in the State of Texas and solving IRS problems. Current member with the American Institute of Certified Public Accountants (AICPA), Texas Society of CPA’s (TSCPA), National Society of Accountants (NSA), Bachelor’s degree in accounting (BBA), Master’s degree in Business Administration (MBA) at Texas A&M Corpus Christi. Experience in a variety of industries as Controller, CFO and tax resolution issues for both business and personal tax cases. 

At Hopkins CPA Firm, we adhere to a stringent editorial policy emphasizing factual accuracy, impartiality and relevance. Our content, curated by experienced industry professionals. A team of experienced editors reviews this content to ensure it meets the highest standards in reporting and publishing.

More Similar Posts
Author

Joe has 30+ years as a Certified Public Accountant licensed in the State of Texas and solving IRS problems. Current member with the American Institute of Certified Public Accountants (AICPA), Texas Society of CPA’s (TSCPA), National Society of Accountants (NSA), Bachelor’s degree in accounting (BBA), Master’s degree in Business Administration (MBA) at Texas A&M Corpus Christi. Experience in a variety of industries as Controller, CFO and tax resolution issues for both business and personal tax cases.