Stock basis is the total amount you’ve invested in a share for tax purposes, and it’s what the IRS subtracts from your sale proceeds to figure out how much of the sale is taxable. A higher basis means a smaller gain and a smaller tax bill. That is the whole reason tracking it matters: every dollar of basis you can document is a dollar the IRS cannot tax when you sell.
Basis starts with what you paid, but it rarely stays there. Corporate actions, reinvested dividends, gifts, inheritances, wash sales, and employer compensation plans all move the number up or down before you ever click sell.
How Basis Starts When You Buy
For stock bought on the open market, your initial basis is the purchase price plus any costs you paid to complete the trade. Brokerage commissions, transfer fees, and recording fees get added to the price of the shares rather than deducted as separate expenses.1Internal Revenue Service. Publication 551 (12/2025), Basis of Assets Pay $50 per share for 100 shares plus $10 in commissions, and your basis is $5,010, not $5,000.
Most investors buy the same stock more than once, at different prices. Each purchase is a separate “lot” with its own basis, and each lot keeps that basis until the shares are sold. Fifty shares bought at $40 in January and another 50 at $48 in June are two lots, not one blended position. Which lot you sell first controls the gain you report, so lot-level records matter as much as the total.
Events That Change Your Basis After You Buy
Your original purchase price is a starting point. Several routine events adjust it over the life of the holding.
Reinvested Dividends
If you enroll in a dividend reinvestment plan and use cash dividends to buy more shares, you owe ordinary income tax on those dividends in the year they’re paid. Because you’ve already been taxed on that money, the reinvested amount is added to your total cost basis.2Internal Revenue Service. FAQs – Capital Gains, Losses, and Sale of Home – Stocks (Options, Splits, Traders) Investors who forget this end up paying tax twice on the same money: once as dividend income, again as capital gain when they sell.
Return of Capital Distributions
Some payments from a company are classified as a return of capital rather than a dividend. They aren’t taxed when received. Instead, the IRS treats them as a partial return of your original investment and you reduce your basis by the amount received. A $10,000 basis reduced by $1,500 of return-of-capital distributions becomes $8,500. Once cumulative return-of-capital distributions drive basis to zero, any further distributions are treated as capital gains in the year received.3Internal Revenue Service. Mutual Funds (Costs, Distributions, Etc.) This catches holders of REITs and master limited partnerships in particular.
Stock Splits and Stock Dividends
A stock split or stock dividend changes your share count but not your total basis. The existing basis spreads across the larger number of shares. One share with a $45 basis, split 3-for-1, becomes three shares each with a $15 basis.4Internal Revenue Service. Publication 550 (2025), Investment Income and Expenses The total stays $45.
Corporate Spinoffs
When a company spins off a division as a separate publicly traded entity, no gain or loss is recognized at the time of the distribution in a tax-free spinoff under IRC Section 355. You allocate your original basis between the parent and the new company based on their relative fair market values immediately after the separation. If your basis in the parent was $10,000 and the parent held 70% of the combined value with the spinoff holding 30%, you’d carry $7,000 into the parent shares and $3,000 into the spinoff shares. Companies typically publish the allocation percentages shareholders should use.
Wash Sales
Sell stock at a loss and buy substantially identical shares within 30 days before or after that sale, and the IRS treats the transaction as a wash sale. The loss deduction is disallowed for that year.5Office of the Law Revision Counsel. 26 U.S.C. 1091 – Loss From Wash Sales of Stock or Securities The 61-day window (30 days on either side) prevents harvesting a paper loss while immediately reestablishing the same position.
The disallowed loss isn’t gone. It’s added to the basis of the replacement shares. Buy a share for $100, sell it for $80, then buy a new share the next day for $80: the $20 disallowed loss rolls into the replacement, giving it a basis of $100.5Office of the Law Revision Counsel. 26 U.S.C. 1091 – Loss From Wash Sales of Stock or Securities When you eventually sell that replacement share outside the wash sale window, the original economic loss shows up again through the higher basis.
Basis When You Didn’t Buy the Shares
Gifts, inheritances, divorce transfers, and employer compensation each set basis under their own rule.
Gifted Stock
Stock given to you during the donor’s lifetime carries a split rule. If you sell at a gain, your basis is the donor’s original adjusted basis, called carryover basis. If you sell at a loss, your basis is the lower of the donor’s adjusted basis or the fair market value on the date of the gift.6Office of the Law Revision Counsel. 26 U.S.C. 1015 – Basis of Property Acquired by Gifts and Transfers in Trust
That split creates a dead zone. Say your uncle bought stock for $50 per share and it was worth $35 the day he gave it to you. Sell at $60 and you have a $10 gain against the $50 basis. Sell at $30 and you have a $5 loss against the $35 basis. Sell at $40 and you have neither: the price sits above the loss basis and below the gain basis, so nothing reportable happens.
If the donor paid gift tax on the transfer, a portion of that tax can increase your basis, based on the ratio of the stock’s net appreciation to the total gift amount.7eCFR. 26 CFR 1.1015-5 – Increased Basis for Gift Tax Paid
Inherited Stock
Stock you inherit gets a stepped-up (or stepped-down) basis equal to the fair market value on the date of the decedent’s death.8Office of the Law Revision Counsel. 26 U.S. Code 1014 – Basis of Property Acquired From a Decedent Every dollar of appreciation that built up during the decedent’s lifetime disappears from the tax base. Shares your parent bought at $10 that were worth $200 on the date of death land in your hands with a $200 basis. You owe tax only on further appreciation from that point.
Inherited stock is automatically treated as held for more than one year no matter how quickly you sell, so any gain qualifies for long-term capital gains rates.9Office of the Law Revision Counsel. 26 U.S. Code 1223 – Holding Period of Property The executor of a large estate can elect an alternate valuation date six months after death if doing so reduces the estate’s value, and that alternate-date value then becomes your basis.10Internal Revenue Service. Gifts and Inheritances
Stock Transferred in a Divorce
Stock transferred between spouses or to a former spouse as part of a divorce carries over the transferor’s adjusted basis. The transfer is tax-free, with no gain or loss recognized by either side. The receiving spouse steps into the transferor’s basis and holding period. To qualify, the transfer must happen within one year after the marriage ends or be related to the divorce.11Office of the Law Revision Counsel. 26 U.S.C. 1041 – Transfers of Property Between Spouses or Incident to Divorce
The practical consequence is that whoever takes the stock also inherits the tax bill on any built-in gain. A $500,000 portfolio with a $100,000 basis is not equal to $500,000 in cash during a settlement, because selling the stock triggers tax on $400,000 of gain.
Employer Stock
For shares received as compensation, the rule is consistent even though the plans differ: your basis equals whatever amount you’ve already paid tax on.
Restricted stock units are taxed as ordinary income when they vest, and the amount reported on your W-2 becomes your basis. RSUs that vested when the stock was $75 give you a $75-per-share basis. Brokers frequently report a cost basis of zero on Form 1099-B for RSU shares because no cash left your pocket, and correcting that mismatch against your W-2 is the difference between paying tax once and paying it twice.
For nonqualified stock options, the spread between the exercise price and the fair market value at exercise is taxed as ordinary income and reported on your W-2. Your basis becomes the FMV at exercise, meaning only appreciation above that point produces additional taxable gain when you sell. Incentive stock options work differently: your basis is the exercise price you paid, and the spread at exercise isn’t taxed as ordinary income for regular tax purposes, though it is a preference item for the alternative minimum tax.
For employee stock purchase plan shares under IRC Section 423, basis starts with the discounted price you actually paid, plus any portion of the discount later taxed as ordinary income.12Office of the Law Revision Counsel. 26 U.S.C. 423 – Employee Stock Purchase Plans
Which Lot’s Basis Applies When You Sell
Selling from a position built over multiple purchases forces a choice: which lot goes out the door? The IRS allows several methods, and the one you use directly changes your reported gain.
First-In, First-Out
FIFO is the default. If you don’t specify otherwise, your broker and the IRS treat the oldest shares as sold first.2Internal Revenue Service. FAQs – Capital Gains, Losses, and Sale of Home – Stocks (Options, Splits, Traders) For a stock that has appreciated, FIFO usually produces the largest gain because the oldest shares carry the lowest basis. It’s the least tax-efficient method by default, and also the one that requires no action.
Specific Identification
Specific identification lets you pick exactly which lot to sell. You can select high-basis shares to shrink a gain or peak-priced shares to harvest a loss. To use it, you must tell your broker which lot you want sold at or before the sale, and you need written confirmation back.4Internal Revenue Service. Publication 550 (2025), Investment Income and Expenses Most brokerage platforms now handle both steps through the trade screen.
Average Cost
Average cost divides your total basis across all shares to produce a single per-share figure. It’s available only for shares of regulated investment companies, which includes mutual funds and certain ETFs, and for shares acquired through a dividend reinvestment plan.13Office of the Law Revision Counsel. 26 U.S. Code 1012 – Basis of Property – Cost It isn’t available for individual stocks bought on the open market outside a DRIP.
What Your Broker Reports and What You Have to Fix
Brokers report cost basis to you and to the IRS on Form 1099-B, but only for “covered” securities purchased after the mandatory reporting dates.14Internal Revenue Service. Instructions for Form 1099-B (2026) The phase-in ran by security type: individual stocks and many ETFs bought on or after January 1, 2011; mutual funds, other ETFs, and DRIP shares on or after January 1, 2012; most bonds and options on or after January 1, 2014; and more complex instruments in 2016.
For non-covered securities bought before those dates, brokers may show basis to you as a courtesy but don’t report it to the IRS. Calculating and reporting the correct basis is on you, using old purchase confirmations, brokerage statements, dividend reinvestment records, or historical price data.
Errors on Form 1099-B are common for RSUs, ESPP shares, inherited stock, and gifted stock, where the broker often doesn’t have complete information. The RSU zero-basis case is the most frequent: the 1099-B shows $0, but your W-2 already reported the vesting value as wages, and the correction on Form 8949 restores that amount as your basis.15Internal Revenue Service. Instructions for Form 8949 Skipping the correction means paying income tax twice on the same money.
How Basis Turns Into a Tax Bill
The math itself is simple. Net sale proceeds minus adjusted basis equals your gain or loss. Positive is a capital gain, negative is a capital loss.
The rate depends on how long you held the shares. Stock held more than one year qualifies for long-term capital gains rates, which for 2026 are 0%, 15%, or 20% depending on taxable income. Stock held one year or less is taxed at ordinary income rates, which run considerably higher for most filers.
Capital losses offset capital gains dollar for dollar. If losses exceed gains in a given year, you can deduct up to $3,000 of the excess against ordinary income, or $1,500 if married filing separately.16Office of the Law Revision Counsel. 26 U.S.C. 1211 – Limitation on Capital Losses Anything above that carries forward indefinitely to future years.
Every adjustment described above lands here, in this one subtraction. An overstated basis can produce a phantom loss the IRS will later disallow. An understated basis quietly overpays tax that you’ll never get back unless you catch the error and amend. The records you keep during the years you hold the stock are what protect the number when you finally sell.