Your capital gains cost basis is what the IRS treats as your investment in an asset, and it’s the number you subtract from your sale proceeds to figure your taxable gain or deductible loss. Start with what you paid, add the costs of acquiring the asset, then adjust it upward for improvements and reinvested income and downward for depreciation and returned capital. Get it wrong and you can end up paying tax on money that was never a real gain, because the sale price alone is not the profit.
What Goes Into Your Starting Basis
For a purchased asset, basis begins with the purchase price, including any debt you take on such as a mortgage. Costs paid to acquire the asset and put it into use get added on top.
For stocks and bonds, basis is the purchase price plus commissions, recording fees, and transfer fees paid at the time of purchase.1Internal Revenue Service. Topic No. 703, Basis of Assets Pay $5,000 for shares and $50 in commissions and your basis is $5,050.
Real estate is where basis gets fatter fast. IRS Publication 551 lists the closing costs you can add: abstract and title search fees, legal fees, recording fees, surveys, transfer taxes, and owner’s title insurance.2Internal Revenue Service. Publication 551 – Basis of Assets You can also include seller obligations you agreed to pay at closing, such as back taxes or repair charges.
Financing costs are the main exception on real estate. Points paid to secure a lower interest rate are not added to basis. They’re treated as deductible interest, either in the year paid on a principal residence bought with cash-method accounting, or spread over the life of the loan.3Internal Revenue Service. Topic No. 504, Home Mortgage Points
For business equipment and machinery, basis includes freight, installation, and other costs required to make the asset operational. Land improvements like grading or clearing are capitalized into the land’s basis, though land itself is never depreciated.
Adjustments That Raise or Lower Basis
Your basis is not frozen at purchase. It moves over the years you hold the asset, and each move changes the gain you’ll eventually report.
Upward Adjustments
Capital improvements are the most common upward adjustment for real estate. An improvement adds value, extends useful life, or adapts the property to a new use. Adding a deck, replacing the entire roof, or finishing a basement all qualify, and the full cost gets added to basis.4Internal Revenue Service. Publication 523, Selling Your Home Routine maintenance and minor repairs do not. Patching a few shingles is a repair; replacing the whole roof is an improvement. Repairs are deductible in the year paid but do nothing for your basis.
Reinvested dividends and capital gains distributions in a mutual fund also increase basis, provided you already paid tax on those distributions. Each reinvestment counts as a new share purchase at the reinvestment price, and the cost of those extra shares becomes part of your total basis.
For S corporation shareholders and partnership partners, income that flows through to your return raises your ownership basis by your share of that income, including separately stated and tax-exempt items.5Internal Revenue Service. S Corporation Stock and Debt Basis Without this step-up, you’d end up taxed twice: once when the income passes through, and again when you sell your interest.
Downward Adjustments
Depreciation is the biggest downward adjustment for business and rental real estate. Federal law requires you to reduce basis by depreciation “allowed or allowable,” whichever is greater.6Office of the Law Revision Counsel. 26 USC 1016 – Adjustments to Basis If you forgot to claim depreciation during years you owned the property, your basis still gets reduced as though you had. Skipping the deduction doesn’t preserve basis; it just costs you a deduction you were entitled to.
There’s a second sting at sale. When you sell depreciated real estate, the portion of your gain attributable to depreciation is taxed as unrecaptured Section 1250 gain at a maximum rate of 25%, higher than the standard long-term capital gains rate that applies to most taxpayers.7eCFR. 26 CFR 1.453-12 – Allocation of Unrecaptured Section 1250 Gain Plenty of rental owners find this out only at closing.
Return-of-capital distributions on corporate stock also cut basis. They aren’t taxed when received, but your basis drops dollar for dollar. Once cumulative return-of-capital distributions exceed your entire basis, further distributions become taxable capital gain.6Office of the Law Revision Counsel. 26 USC 1016 – Adjustments to Basis
Basis for Inherited Property
Inheritance breaks the normal rules in the recipient’s favor. When you inherit property, your basis is not what the deceased paid. It resets to the fair market value on the date of death.8Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent A parent who bought stock decades ago for $10,000 that was worth $200,000 at death leaves you with a $200,000 basis. All the lifetime appreciation disappears from the tax base.
Inherited assets are automatically long-term regardless of how long you or the decedent held them, so any gain qualifies for long-term capital gains rates even if you sell the next day.
In community property states (roughly nine of them), a married couple gets a bigger benefit. When one spouse dies, both halves of community property step up to fair market value, not just the decedent’s half.8Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent In a common-law state, the surviving spouse keeps original basis in their own half.
Basis for Gifted Property
Gifts don’t get the step-up. Your basis in gifted property is generally the same as the donor’s basis, carrying over unchanged.9Office of the Law Revision Counsel. 26 USC 1015 – Basis of Property Acquired by Gifts and Transfers in Trust If your uncle paid $30,000 for stock and gave it to you when it was worth $80,000, your basis is $30,000. The built-in gain rides along with the gift.
A special dual-basis rule kicks in when the fair market value at the time of the gift is lower than the donor’s basis. You then use two different figures depending on how the sale turns out:10Internal Revenue Service. Property (Basis, Sale of Home, Etc.)
- Selling at a gain: use the donor’s higher carryover basis.
- Selling at a loss: use the lower fair market value at the time of the gift.
- Selling for a price between those two figures: no gain or loss is recognized.
The dead zone between the two basis figures exists so people can’t transfer depreciated assets to family members purely to generate a tax loss. Your holding period for gifted property includes the donor’s holding period, so long-term treatment is often available right away.
Stock Splits and Wash Sales
A stock split rearranges basis without changing it. You spread the same total cost across more shares. Own 100 shares with a total basis of $1,500, sit through a 2-for-1 split, and you now own 200 shares at $7.50 each.11Internal Revenue Service. Stocks (Options, Splits, Traders) 7 Reverse splits work the same way in the other direction. Brokers track this for covered securities, but a quick post-split check is worth the two minutes.
Wash sales redirect a loss into basis. If you sell a security at a loss and buy the same or a substantially identical security within 30 days before or after the sale, the loss is disallowed for that year. The disallowed loss then gets added to the basis of the replacement shares, deferring rather than eliminating the tax benefit.12Internal Revenue Service. Case Study 1 – Wash Sales Sell for a $250 loss, buy the replacement for $800, and your new basis is $1,050. The old shares’ holding period tacks onto the replacement.
Choosing Which Shares You Sold
When you own identical shares bought at different times and prices, you need to pick which ones you’re selling. The choice can move your tax bill meaningfully.
First-in, first-out (FIFO) is the default. Without a specific instruction, the IRS treats your oldest shares as the ones sold first.13Internal Revenue Service. Stocks (Options, Splits, Traders) 3 In a rising market those oldest shares usually carry the lowest basis, which produces the largest taxable gain. Simple, but rarely tax-efficient.
Specific identification gives you control. Tell your broker exactly which lot to sell and you can pick shares with the highest basis to shrink the current gain. The IRS requires that you identify the specific shares at the time of sale and receive written confirmation from your broker within a reasonable time.14Internal Revenue Service. Publication 550 – Investment Income and Expenses Most brokerage platforms let you pick tax lots at checkout.
Mutual fund investors have a third option: average cost. Add up the total cost of all shares in the fund, divide by the share count, and use that single per-share figure.15Internal Revenue Service. Mutual Funds (Costs, Distributions, Etc.) 1 It saves you from tracking years of small reinvestments. You have to elect average cost; it doesn’t apply automatically, and the rules for revoking it depend on whether shares are covered or noncovered, so check with your broker before switching.
Two Situations That Change the Basis Math
Two specific transactions change how basis works for the property involved.
A Section 1031 exchange lets you swap one piece of investment or business real property for another and defer the capital gains tax. Your basis in the replacement property carries over from the property you gave up, reduced by any cash you received and increased by any gain you recognized on the exchange.16Office of the Law Revision Counsel. 26 USC 1031 – Exchange of Real Property Held for Productive Use or Investment Since 2018, like-kind treatment applies only to real property; personal property such as equipment, vehicles, and artwork no longer qualifies.17Internal Revenue Service. Instructions for Form 8824 Each successive exchange pushes a smaller basis forward and a bigger deferred gain along with it.
The principal residence exclusion works on top of a normal basis calculation. Federal law lets you exclude up to $250,000 of gain from the sale of your main home, or $500,000 if you’re married filing jointly, if you owned and used it as your primary residence for at least two of the five years before the sale and haven’t used the exclusion on another sale in the prior two years.18Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Basis still matters. The calculation runs sale price, minus selling expenses, minus adjusted basis, equals gain, and the exclusion then shelters part of that gain.4Internal Revenue Service. Publication 523, Selling Your Home If your gain runs past the exclusion cap, every improvement you tracked over the years directly reduces the taxable portion.
Keeping Records That Hold Up
The burden of proving basis is on you. If the IRS questions your reported gain and you can’t produce records, your basis can be treated as zero, which turns the entire sale price into taxable gain.
The IRS says to keep property records until the statute of limitations expires for the tax year in which you dispose of the property.19Internal Revenue Service. How Long Should I Keep Records? For property held many years, that means keeping records the entire time you own it, plus at least three years after filing the return that reports the sale. If you acquired property in a tax-deferred exchange, keep records for both the old and new property until you finally sell without another exchange.
What to save depends on what you own:
- Real estate: the original closing statement, contractor invoices for every capital improvement, depreciation schedules if the property was rented or used in a business, and records of casualty losses or insurance reimbursements.
- Stocks and mutual funds: brokerage statements showing purchase dates, prices, and commissions. Your broker reports basis on Form 1099-B for covered securities, but broker records are not always complete for shares acquired before reporting requirements took effect, for reinvested dividends, or for corporate actions like mergers and spinoffs.20Internal Revenue Service. About Form 1099-B, Proceeds From Broker and Barter Exchange Transactions
- Inherited property: the estate’s date-of-death valuation, appraisal reports, or the estate tax return showing the fair market value used.
- Gifted property: the donor’s original purchase records showing their basis, and documentation of the fair market value at the time of the gift.
Digital storage makes this easier than it used to be. The discipline of actually saving the documents is what still trips people up. The worst time to reconstruct a cost basis is the week you’re filing the return that reports a six-figure gain.