What Is Cost Basis and Why It Matters for Capital Gains

Cost basis is what you paid for an asset, including commissions, closing costs, and other acquisition expenses, and it is the figure the IRS subtracts from your sale price to calculate the capital gain or loss you owe tax on.1Office of the Law Revision Counsel. 26 U.S.C. 1012 – Basis of Property-Cost Get the number right and you pay tax only on your actual profit. Get it wrong and you either overpay or face penalties for underreporting. The rules shift depending on how you acquired the property and what happened to it while you owned it.

How Cost Basis Turns Into a Tax Bill

Sell an asset for more than your basis and the difference is a capital gain. Sell for less and it’s a capital loss.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses A property sold for $300,000 with a basis of $200,000 produces a $100,000 gain. Every dollar you can legitimately add to basis is a dollar the IRS cannot tax.

Paper gains don’t count. If your portfolio rises but you haven’t sold, the gain is unrealized and no tax is due. Only a sale triggers the reporting obligation.

Short-Term Versus Long-Term Rates

Holding period determines the rate. Assets held one year or less produce short-term gains taxed as ordinary income. Assets held longer than a year qualify for long-term capital gains rates of 0%, 15%, or 20%, depending on taxable income and filing status.3Office of the Law Revision Counsel. 26 U.S.C. 1222 – Other Terms Relating to Capital Gains and Losses2Internal Revenue Service. Topic No. 409, Capital Gains and Losses That distinction alone can cut a tax bill nearly in half on a profitable sale.

Higher earners owe an additional 3.8% Net Investment Income Tax when modified adjusted gross income exceeds $200,000 for single filers or $250,000 for married joint filers.4Internal Revenue Service. Topic No. 559, Net Investment Income Tax Someone in the top long-term bracket who also owes NIIT effectively pays 23.8% on gains.

When You Sell at a Loss

Capital losses offset gains of the same type first. Any net loss beyond that can reduce ordinary income by up to $3,000 per year, or $1,500 if married filing separately.5Office of the Law Revision Counsel. 26 U.S. Code 1211 – Limitation on Capital Losses Anything above the cap carries forward to future tax years until used up.2Internal Revenue Service. Topic No. 409, Capital Gains and Losses Tracking basis on a losing investment matters just as much as on a winner. Lose the records showing what you paid, and you may not be able to claim the full loss.

What Goes Into Your Initial Basis

Basis starts with the purchase price but includes every cost required to acquire the asset. For stocks and bonds, that means the price plus any commissions or transaction fees.6Internal Revenue Service. Publication 551 (12/2025), Basis of Assets Buy 100 shares at $50 with a $10 commission and your basis is $5,010, not $5,000.

Real estate pulls in a longer list. Legal fees for title searches and deed preparation, title insurance, recording fees, transfer taxes, and survey costs all become part of basis.6Internal Revenue Service. Publication 551 (12/2025), Basis of Assets So do seller expenses you agreed to cover, such as back taxes or sales commissions. Documenting each line at closing saves grief years later.

Events That Change Your Basis Over Time

Basis is not frozen. Federal law requires adjustments during ownership, producing what’s called adjusted basis when you eventually sell.7Office of the Law Revision Counsel. 26 U.S.C. 1011 – Adjusted Basis for Determining Gain or Loss8Office of the Law Revision Counsel. 26 U.S. Code 1016 – Adjustments to Basis

Capital Improvements to Real Estate

Permanent improvements raise your basis. A new roof, a room addition, a kitchen renovation, and central air conditioning all qualify because they extend the property’s useful life or add something new.6Internal Revenue Service. Publication 551 (12/2025), Basis of Assets Routine maintenance like painting or fixing a faucet does not, because it only preserves the current condition.

Spend $40,000 on a kitchen in a home with a $300,000 basis and your adjusted basis rises to $340,000. That $40,000 reduces your taxable gain when you sell, but only if you can prove it with receipts.

Stock Splits and Reinvested Dividends

A stock split leaves total basis alone but changes per-share basis. Own 100 shares with a total basis of $1,500 and a two-for-one split leaves you 200 shares at $7.50 each instead of $15.9Internal Revenue Service. Stocks (Options, Splits, Traders) 7 Forgetting to reallocate after a split is a common mistake that makes gains look larger than they are.

Reinvested dividends work differently. Each reinvestment is a new purchase, so it adds to total basis. You already paid income tax on the dividend the year you received it. Without the basis increase, you’d be taxed on the same money twice at sale.

Casualty Losses and Depreciation

Property damage triggers basis adjustments both ways. Insurance reimbursements and any casualty loss deduction you claim reduce basis; money spent restoring the property to its previous condition adds back.10Internal Revenue Service. Publication 547 (2025), Casualties, Disasters, and Thefts

Depreciation on rental or business property reduces basis every year, and this catches landlords off guard. Even if you never claimed the depreciation deduction, the IRS still reduces your basis by the amount you were entitled to deduct.11Internal Revenue Service. Publication 946 (2024), How To Depreciate Property The statutory phrase is “allowed or allowable, whichever is greater.” Skipping the deduction doesn’t preserve basis. It just means you missed the tax break and still face the lower basis when you sell. Depreciated property sold at a gain also faces depreciation recapture, which taxes the portion of the gain attributable to earlier deductions at higher rates.

Basis for Inherited Property

Inherited assets get one of the most favorable rules in the tax code. Rather than carrying over what the deceased owner paid, inherited property receives a stepped-up basis equal to fair market value on the date of death.12Office of the Law Revision Counsel. 26 U.S.C. 1014 – Basis of Property Acquired From a Decedent A parent who bought a home for $50,000 and left it to you worth $500,000 hands you a basis of $500,000. All the appreciation during their lifetime disappears for income tax purposes. An estate’s executor may elect an alternate valuation date six months after death, applied to the whole estate.13Office of the Law Revision Counsel. 26 U.S. Code 2032 – Alternate Valuation

Basis for Gifted Property

Lifetime gifts follow the opposite rule. You take over the donor’s original basis, known as carryover basis.14Office of the Law Revision Counsel. 26 U.S.C. 1015 – Basis of Property Acquired by Gifts and Transfers in Trust Stock your uncle bought for $10 a share and gave you when it was worth $100 leaves you with a $10 basis and tax owed on the full $90 of appreciation at sale.

A twist applies when fair market value at the time of the gift is lower than the donor’s basis. If your uncle paid $100 for stock worth $60 when he gave it to you, you use his $100 basis to calculate a gain and the $60 fair market value to calculate a loss. Sell somewhere between the two and you have neither. When the donor paid federal gift tax on the transfer, part of that tax can increase your basis for gifts made after 1976, though never above fair market value at the time of the gift.15Office of the Law Revision Counsel. 26 U.S. Code 1015 – Basis of Property Acquired by Gifts and Transfers in Trust

Choosing Which Shares You Sold

When you’ve bought shares of the same security at different times and prices, you need a method for identifying which shares you sold. The choice directly changes your gain or loss.

  • First-in, first-out treats the earliest shares as the ones sold first. Most brokers apply this as the default. In a rising market, it tends to produce the largest gains because your oldest shares typically have the lowest basis.
  • Specific identification lets you pick exactly which shares to sell at the time of the trade. Selling your highest-cost shares first minimizes gains; selling low-basis shares can make sense when you have losses elsewhere to absorb the gain.
  • Average cost divides the total cost of all shares in a mutual fund by the total number of shares for a single per-share basis. It’s available for mutual fund shares and shares acquired through dividend reinvestment plans, and it simplifies years of small reinvestment purchases.16Internal Revenue Service. Mutual Funds (Costs, Distributions, Etc.)

For shares acquired after 2010, called covered securities, brokers must report your basis to the IRS on Form 1099-B.17Internal Revenue Service. Instructions for Form 1099-B Older shares may lack broker-reported basis entirely, which puts reconstruction on you.

The Wash Sale Trap

Sell a security at a loss and buy the same or a substantially identical security within 30 days before or after the sale, and the IRS disallows the loss.18Office of the Law Revision Counsel. 26 U.S. Code 1091 – Loss From Wash Sales of Stock or Securities The loss isn’t gone for good. It gets added to the basis of the replacement shares, deferring the benefit until you sell those.

Sell shares at a $250 loss and buy replacements for $800 inside the window, and your basis in the new shares becomes $1,050 rather than $800.19Internal Revenue Service. Case Study 1: Wash Sales The original holding period carries over too. Active traders and anyone with automatic dividend reinvestment stumble into wash sales more than they realize.

Selling a Home

Most homeowners never owe capital gains on a primary residence. You can exclude up to $250,000 of gain, or $500,000 if married filing jointly, on the sale of your main home.20Office of the Law Revision Counsel. 26 U.S.C. 121 – Exclusion of Gain From Sale of Principal Residence You must have owned and used the home as your main residence for at least two of the five years before sale.21Internal Revenue Service. Sale of Residence – Real Estate Tax Tips The two years don’t need to be consecutive.

Basis still matters here. Buy a house for $200,000, add $80,000 of capital improvements, and sell for $600,000, and your gain is $320,000. A single filer owes tax on $70,000; a married joint filer owes nothing. Those improvement receipts translate straight into cash.

Reporting and Keeping Records

Sales of capital assets go on Form 8949, which reconciles broker-reported figures on Form 1099-B with what you’re actually reporting.22Internal Revenue Service. About Form 8949, Sales and Other Dispositions of Capital Assets Totals from Form 8949 flow to Schedule D of your Form 1040. If broker-reported basis is correct, reporting is straightforward. Corrections are needed when brokers missed wash sale adjustments, when shares predate broker reporting requirements, or when the asset came from a gift or inheritance the broker has no way to value.

Keep records of anything that affects basis.6Internal Revenue Service. Publication 551 (12/2025), Basis of Assets For investments, that means trade confirmations, reinvestment statements, and records of corporate actions like splits or mergers. For real estate, the closing disclosure, receipts for capital improvements, casualty loss records, and every year of depreciation for rental property. The IRS audit window runs three years from the return that reports the sale, but assets often outlive that. A rental owned for 20 years needs 20 years of paperwork at sale. Digital copies are fine if legible and backed up. The time to file the paperwork is when you buy the asset or make the improvement, not the year you sell and try to reconstruct decades of history from memory.