What Is Stock Basis and How Does It Affect Taxes?

Stock basis is the total after-tax amount you have invested in a share of stock, and it is the number the IRS subtracts from your sale proceeds to figure your capital gain or loss. Sell for more than your basis and you owe tax on the difference; sell for less and you have a deductible loss. A higher basis always means a smaller taxable gain, so tracking it accurately across every purchase, reinvested dividend, and corporate action is what separates an accurate tax return from an expensive one.

How Your Starting Basis Is Set When You Buy

For stock you buy on the open market, your initial basis is the purchase price plus any costs you paid to complete the trade. Commissions, transfer fees, and recording fees are added to the price of the shares rather than deducted as expenses.1Internal Revenue Service. Publication 551 (12/2025), Basis of Assets Pay $50 per share for 100 shares with a $10 commission and your basis is $5,010, not $5,000.

Most investors end up buying the same stock at different prices over time, which creates separate “lots.” Someone who buys 50 shares at $40 in January and another 50 at $48 in June holds two lots with two different per-share bases. Each lot keeps its own basis until those specific shares are sold, and which lot you sell changes the gain you report. Not tracking lots separately is where many investors get into trouble at tax time.

Events That Change Your Basis After You Buy

Several things can push your basis up or down while you hold the stock. Catching every one of them is how you avoid paying tax on the same dollar twice, or missing a basis cut that would otherwise surprise you years later.

Reinvested Dividends

If you enroll in a dividend reinvestment plan and automatically buy more shares with your cash dividends, you still owe ordinary income tax on those dividends in the year you receive them. Because you have already been taxed on that money, the reinvested amount gets added to your total basis. Investors who forget to count reinvested dividends end up paying tax on the same money twice, first as dividend income and again as part of the capital gain when they sell.2Internal Revenue Service. FAQs – Capital Gains, Losses, and Sale of Home – Stocks (Options, Splits, Traders)

Return of Capital Distributions

Some corporate distributions are classified as a return of capital rather than a dividend. These are not taxed when you receive them, because the IRS treats them as the company handing back a slice of your original investment. You reduce your basis by the distribution amount.3Internal Revenue Service. Mutual Funds (Costs, Distributions, Etc.) If your basis was $10,000 and you received $1,500 of return-of-capital distributions over several years, your adjusted basis drops to $8,500. Once cumulative return-of-capital distributions take your basis to zero, any further distributions are taxed as capital gains in the year received. This catches holders of REITs and master limited partnerships off guard most often.

Stock Splits and Stock Dividends

A split or stock dividend changes your share count but not your total basis. The existing basis spreads across the larger number of shares. If you owned one share with a $45 basis and the company did a 3-for-1 split, you now own three shares with a $15 basis each.4Internal Revenue Service. Publication 550 (2025), Investment Income and Expenses Total basis remains $45.

Spinoffs and Reorganizations

When a company spins off a division into a separately traded entity in a tax-free spinoff under IRC Section 355, you do not recognize gain or loss at the time of the distribution. Instead, you allocate your original basis in the parent between the parent and the new entity based on their relative fair market values immediately after the separation. The parent company usually publishes the allocation percentages shareholders should use. Keep that documentation, because the adjustment can create confusion years later when you sell one position but not the other.

Wash Sales

Sell stock at a loss and buy substantially identical shares within 30 days before or after that sale, and the IRS treats it as a wash sale and disallows the loss for that year.5Office of the Law Revision Counsel. 26 U.S.C. 1091 – Loss From Wash Sales of Stock or Securities The disallowed loss is not gone. It is added to the basis of the replacement shares, which preserves the economic loss until you eventually sell those replacement shares outside the 61-day window. Buy a share for $100, sell for $80, buy a replacement the next day for $80, and the replacement share’s basis becomes $100.

Basis When You Didn’t Buy the Stock Yourself

Stock that arrives in your account through a gift, an inheritance, a divorce settlement, or an employer plan follows its own basis rules. Each of these situations has traps that cost real money if missed.

Gifted Stock

When someone gives you stock during their lifetime, your basis depends on whether you later sell at a gain or a loss. For a gain, you use the donor’s adjusted basis, often called carryover basis, which means you inherit the donor’s unrealized appreciation.6Office of the Law Revision Counsel. 26 U.S.C. 1015 – Basis of Property Acquired by Gifts and Transfers in Trust For a loss, your basis is the lower of the donor’s adjusted basis or the stock’s fair market value on the date of the gift.

That dual-basis rule creates a zone with no gain and no loss. Say your uncle bought shares at $50 and they were worth $35 the day he gave them to you. Sell at $60 and your gain basis of $50 produces a $10 gain. Sell at $30 and your loss basis of $35 produces a $5 loss. Sell anywhere between $35 and $50 and you have neither a reportable gain nor a reportable loss, because the price is below the gain basis and above the loss basis. If the donor paid gift tax on the transfer, a portion of that tax tied to the stock’s net appreciation can increase your basis.7eCFR. 26 CFR 1.1015-5 – Increased Basis for Gift Tax Paid

Inherited Stock

Stock you inherit gets a basis equal to the fair market value on the date of the decedent’s death, a stepped-up (or stepped-down) basis.8Office of the Law Revision Counsel. 26 U.S. Code 1014 – Basis of Property Acquired From a Decedent This wipes out every dollar of appreciation that accrued during the decedent’s lifetime. If your parent bought shares at $10 decades ago and they were worth $200 at death, your basis is $200 and the $190 of appreciation is never taxed. Inherited stock is automatically treated as held for more than one year, so any gain qualifies for long-term capital gains rates regardless of how quickly you sell.9Office of the Law Revision Counsel. 26 U.S. Code 1223 – Holding Period of Property

If the executor of a larger estate elects the alternate valuation date six months after death, the FMV on that date becomes your basis instead.10Internal Revenue Service. Gifts and Inheritances Married couples in community property states get an added advantage: when one spouse dies, both halves of community property stock get stepped up to fair market value, not just the deceased spouse’s half. In common-law states only the decedent’s share gets the step-up.

Stock Transferred in a Divorce

Stock transferred between spouses, or to a former spouse incident to divorce, carries over the transferor’s basis and holding period. The transfer itself is tax-free.11Office of the Law Revision Counsel. 26 U.S.C. 1041 – Transfers of Property Between Spouses or Incident to Divorce A transfer qualifies if it happens within one year after the marriage ends or is otherwise related to the divorce. The practical consequence matters in settlement negotiations: a portfolio worth $500,000 with a $100,000 basis is not the same as $500,000 in cash, because selling triggers tax on $400,000 of built-in gain. Whoever accepts the stock accepts the embedded tax bill.

Employer Stock

Stock you receive from your employer follows one rule across every plan type: your basis equals whatever amount you have already paid tax on.

RSUs are taxed as ordinary income when they vest, and the amount reported as wages on your W-2 becomes your basis. If shares vested when the stock was at $75 and that $75 per share hit your W-2, your basis is $75. Watch for a common broker error here: Form 1099-B often shows a $0 cost basis for RSU shares because you paid nothing out of pocket. Leaving that uncorrected means paying tax a second time on income already withheld through payroll.

For an employee stock purchase plan qualified under IRC Section 423, basis starts with the discounted price you actually paid, plus any portion of the employer discount later recognized as ordinary income.12Office of the Law Revision Counsel. 26 U.S.C. 423 – Employee Stock Purchase Plans A disqualifying disposition (selling before the holding period) treats the full discount as ordinary income and adds it to basis; a qualifying disposition treats a smaller portion that way.

With incentive stock options, your basis in the shares is simply the exercise price you paid. A $20 strike on 500 options gives you $10,000 of basis. With nonqualified stock options, the spread between the strike and the fair market value at exercise is taxed as ordinary income on your W-2, and your basis becomes that FMV at exercise.

If you receive actual restricted stock (not RSUs), you can file a Section 83(b) election within 30 days of grant to be taxed on the grant-date value instead of the vesting-date value. Pay ordinary income tax on the small grant-date figure, set basis there, and all future appreciation is capital gain. The election is irrevocable, so if the stock falls or you leave before vesting, the tax you paid is gone.

Choosing Which Shares You Sell

When you sell from a position built across multiple purchases, you have to tell the IRS which lot went out the door, because each lot has a different basis and therefore a different gain. The IRS allows a few methods.

First-in, first-out is the default. Say nothing and the oldest shares are treated as sold first.2Internal Revenue Service. FAQs – Capital Gains, Losses, and Sale of Home – Stocks (Options, Splits, Traders) For a stock that has generally gone up, FIFO usually produces the largest gain because the oldest shares have the lowest basis.

Specific identification gives you the most control. You tell your broker exactly which lot to sell, which lets you pick the highest-basis shares to minimize gains or target losing lots for tax-loss harvesting. You have to make the identification at or before the time of sale and get written confirmation from the broker.4Internal Revenue Service. Publication 550 (2025), Investment Income and Expenses Most online brokerages let you select lots on the trade screen, which handles both requirements.

Average cost blends your total basis across all shares into a single per-share figure. It is 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 You cannot use average cost on individual stocks bought on the open market outside a DRIP.

What Your Broker Reports and What You Have to Track Yourself

Brokers report your basis to both you and the IRS on Form 1099-B, but only for “covered” securities, meaning those purchased after mandatory reporting rules took effect.14Internal Revenue Service. Instructions for Form 1099-B (2026) Individual stocks bought on or after January 1, 2011 are covered; mutual funds, other ETFs, and DRIP shares bought on or after January 1, 2012 are covered; most bonds and options bought on or after January 1, 2014 are covered, with more complex instruments phased in by 2016.

For non-covered securities bought before those dates, your broker may show basis as a courtesy but does not report it to the IRS. You are still responsible for the correct number on your return. If you have held the same stock since before 2011, you need to dig up purchase records, old brokerage statements, DRIP records, or historical price data to reconstruct basis.

Errors on 1099-B are common, especially for RSUs, ESPP shares, inherited stock, and gifted stock. You fix them on Form 8949. If the broker reported an incorrect basis to the IRS (Box A or D transactions), enter the broker’s incorrect basis in column (e), use adjustment code B in column (f), and put the correction amount in column (g). If the broker did not report basis to the IRS (Box B or E), just enter the correct basis directly in column (e) and leave column (g) at zero.15Internal Revenue Service. Instructions for Form 8949 The RSU zero-basis problem is the most frequent application: your 1099-B shows $0 because you paid nothing in cash, your W-2 shows (for example) $15,000 of income at vesting, and code B adds that $15,000 back as basis so you are not taxed on it twice.

How Basis Translates Into Your Tax Bill

The calculation itself is straightforward: net sale proceeds minus adjusted basis equals your capital gain or loss. Positive is a gain, negative is a loss.

How the gain is taxed depends on holding period. Shares held more than one year qualify for long-term capital gains rates, which for 2026 are 0%, 15%, or 20% depending on your taxable income. Shares held one year or less are taxed at your ordinary income rates, which run higher.

Capital losses offset capital gains dollar for dollar. If losses exceed gains in a year, you can deduct up to $3,000 of the excess against ordinary income ($1,500 if married filing separately), and anything left carries forward to future years indefinitely.16Office of the Law Revision Counsel. 26 U.S.C. 1211 – Limitation on Capital Losses That is why precise basis tracking pays off: an overstated basis creates a phantom loss the IRS can later disallow, and an understated basis quietly costs you tax dollars you will never get back.