What Is Cost Basis?

Last updated July 2026

Short answer

Cost basis is what you paid for an investment for tax purposes: the purchase price plus any commissions or fees. It matters because your taxable capital gain is your sale proceeds minus your basis, so an accurate basis is what keeps you from overpaying or underpaying. Basis is not always static: reinvested dividends add to it (because they were already taxed), and stock splits divide the per-share basis across more shares without changing the total. When you have bought the same stock at different prices, the accounting method decides which shares you sell: FIFO sells the oldest first by default, while specific-lot identification lets you choose exactly which shares to sell for tax control. Brokers report basis on Form 1099-B, and inherited shares generally get a stepped-up basis to the value at death. Walnut, an AI investing app, can show how your positions have moved, but it is not an investment adviser or a tax adviser and is not your official basis record. This is general information, not tax advice.

Cost basis sounds like accounting trivia until you realize it is the number that decides how much tax you owe on a sale. Get it wrong and you can pay tax on money you already paid tax on, or underpay and owe a correction. This guide explains what basis includes, how it sets your gain, the everyday events that adjust it, the FIFO versus specific-lot methods and why lot choice gives you real tax control, how your broker reports it, and the special rules for inherited and gifted shares. It is descriptive and educational, not a set of buy or sell calls, and it is not tax advice. Rules change and depend on your circumstances, so verify with the IRS or a licensed professional.

What cost basis is, and why the gain depends on it

Cost basis is the amount you have invested in an asset for tax purposes. In the simplest case it is the price you paid plus any commissions or transaction fees. If you buy 10 shares at 100 dollars each with a 5 dollar commission, your basis is 1,005 dollars. When you later sell, your taxable gain or loss is the sale proceeds minus that basis: sell those shares for 1,600 dollars and your taxable gain is 595, not the full 1,600.

This is why basis is worth caring about. The gain is what gets taxed, and the gain is measured entirely against basis, so an inaccurate basis directly distorts your bill. Overstate it and you underpay tax, which invites a correction; understate it and you overpay on a gain that was never really that large. Basis is the quiet anchor under every capital gains calculation, which is why the rest of this guide is about keeping it right. This is general information, not tax advice.

Reinvested dividends add to basis

One of the most common and expensive basis mistakes involves reinvested dividends. When a stock or fund pays a dividend and you have it automatically reinvested, that payout was already taxed as income in the year you received it. The reinvested dollars then buy new shares, and that amount becomes part of your cost basis in those new shares. If you ignore this, you will overstate your gain when you sell and end up paying tax twice on the same money.

Over years of automatic reinvestment, these small additions accumulate into a meaningfully higher basis. A fund position you have held for a decade with dividends reinvested has a basis well above your original purchase, and treating it as if you only paid the initial amount would overstate the taxable gain substantially. Reinvested dividends are taxed each year regardless, as covered in how stocks are taxed; tracking their addition to basis is what prevents the double count. This is not tax advice.

Stock splits adjust per-share basis

A stock split changes how many shares you hold but not how much you have invested, and your basis follows the same logic. In a 2-for-1 split, each share becomes two, so your share count doubles and your per-share basis is cut in half; your total basis is unchanged. If you held 100 shares with a 50 dollar basis each, after the split you hold 200 shares with a 25 dollar basis each, still 5,000 dollars in total.

Because the total does not change, a split is not a taxable event on its own; you owe nothing simply because a company split its stock. The only thing to keep straight is the new per-share figure, so that when you eventually sell some of the shares you use the adjusted basis rather than the pre-split number. Reverse splits work the same way in the other direction, raising per-share basis as the share count falls. This is general information, not tax advice.

FIFO vs specific-lot identification

Once you have bought the same stock at different prices over time, each purchase is a separate lot with its own basis, and a question arises when you sell only part of the position: which shares did you sell? The default answer is FIFO, first in first out, which treats you as selling your oldest shares first. FIFO is simple, but those oldest shares often have the lowest basis and therefore the largest gain, which is not always what you want.

Specific-lot identification is the alternative that gives you control. It lets you name exactly which lots to sell, so you can pick high-basis shares to keep a gain small, choose long-term lots to get the lower rate, or deliberately realize a loss for tax-loss harvesting. The catch is that specific-lot selection usually must be elected at the time of the sale, with your broker, and properly documented. This is exactly the kind of decision where the details matter, so confirm the mechanics with your broker and a tax professional. This is not tax advice.

How brokers report basis on Form 1099-B

You do not have to track all of this by hand for most modern holdings. Brokers are required to track and report cost basis for covered securities, which includes most stock and fund shares purchased in recent years. At tax time your broker issues Form 1099-B, which lists your sale proceeds, your cost basis, and the resulting gain or loss, and sends a copy to the IRS. That form is the starting point for reporting your investment sales.

The gap to watch for is non-covered securities: shares bought long ago, transferred from another institution, or otherwise outside the reporting rules may show a missing or unverified basis, and you are responsible for supplying it. It is always worth checking the 1099-B against your own records, especially for older lots and anything with years of reinvested dividends. Your brokerage forms, not any app, are the official record. This is general information, not tax advice.

Inherited and gifted shares: the step-up rule

Basis works differently when you did not buy the shares yourself. Inherited stock generally receives a stepped-up basis: your basis is reset to the market value on the date of the original owner's death, rather than what they paid. If someone bought a stock decades ago for 5,000 dollars and it was worth 50,000 when they passed, an heir's basis is generally the 50,000, so a large unrealized gain can effectively disappear for the heir.

Gifted shares follow a different rule: you usually take over the giver's original basis, so the built-in gain comes with the gift. These rules have important nuances around holding periods, joint ownership, and estate circumstances, and they are precisely the kind of situation where a small detail changes the outcome. Treat this as an overview and confirm the specifics with a tax professional. This is general information, not tax advice.

What changes your cost basis, at a glance

EventWhat happensEffect on basis
Initial purchaseYou buy sharesBasis = purchase price plus any commissions or fees
Reinvested dividendA dividend buys more sharesThe reinvested amount is added as basis in the new shares (it was already taxed)
Stock splitOne share becomes severalTotal basis is unchanged; per-share basis is divided across the new share count
Return of capitalA distribution labeled return of capitalLowers your basis rather than being taxed as income that year
Inherited sharesYou inherit stockBasis is generally stepped up to the value on the date of death, not the original cost

The through-line is that basis is a living number, not just your first purchase price. Reinvested dividends raise it, splits redistribute it, returns of capital lower it, and inheritance can reset it entirely. Keeping it accurate is what makes your eventual capital gains calculation correct. Every rule here can change and depends on your individual circumstances, so verify current details with the IRS or a licensed professional before making any decision.

Where Walnut fits

Your official cost basis lives with your brokerage and its Form 1099-B, and that is where any tax figure should come from. What an AI assistant that can read across your accounts adds is a plain-language view of how each position has moved, which is the context around basis rather than the basis itself. Walnut lets you connect any major US broker, then chat through Claude, ChatGPT, or its built-in AI to see how each holding has performed and how long you have held it. You can build baskets around a plan, track every position against the S&P 500, and place trades that Walnut only sends to your broker after you approve them. It reads your accounts by default and does not move money on its own. Walnut is not an investment adviser or a tax adviser, it is not the record of your cost basis, and it does not tell you which lots to sell or what to buy.

Try Walnut on top of your broker

Walnut connects your accounts, then helps you see how each position has moved and how long you have held it, by chatting through Claude, ChatGPT, or its built-in AI. Walnut is not an investment adviser or a tax adviser and does not tell you what to buy.

FAQ

What is cost basis?

Cost basis is what you paid for an investment for tax purposes: the purchase price plus any commissions or fees. It is the number your sale price is measured against to find your taxable gain or loss. If you buy a stock for 1,000 dollars including fees and later sell it for 1,600, your basis is 1,000 and your taxable gain is 600. Basis can adjust over time for events like reinvested dividends and splits. This is general information, not tax advice.

How is cost basis used to calculate a gain?

Your taxable capital gain is the sale proceeds minus your cost basis. Sell for more than your basis and you have a gain; sell for less and you have a loss that can offset other gains. Because the gain is measured against basis, an accurate basis is essential: overstating it understates your tax, and understating it makes you overpay. Brokers report basis to help, but it is worth checking. Consult a tax professional.

Do reinvested dividends add to my cost basis?

Yes. When a dividend is reinvested to buy more shares, that reinvested amount becomes part of your cost basis in the new shares, because you already paid tax on the dividend the year it was received. Forgetting this is a common and costly mistake: it makes people overstate their gain and pay tax twice on the same dollars. Keep track of reinvestments, or rely on your broker's basis records. This is not tax advice.

How does a stock split affect cost basis?

A stock split does not change your total cost basis, only how it is spread across shares. In a 2-for-1 split, your share count doubles and your per-share basis is halved, so the total is the same. For example, 100 shares with a 50 dollar basis each become 200 shares with a 25 dollar basis each, still 5,000 dollars total. This is why a split does not create a taxable event by itself. Verify with a tax professional.

What is the difference between FIFO and specific-lot identification?

When you have bought the same stock at different prices, the method decides which shares you are treated as selling. FIFO, first in first out, is the default and sells your oldest shares first. Specific-lot identification lets you name exactly which shares (lots) to sell, so you can choose high-basis lots to reduce a gain or low-basis lots deliberately. Specific-lot gives more tax control but must usually be elected at the time of sale. Consult a tax professional.

Do brokers report cost basis to the IRS?

Yes, for most stock and fund shares bought in recent years. Your broker tracks basis and reports it, along with your sale proceeds and gain or loss, on Form 1099-B, which is also sent to the IRS. Shares bought long ago may be non-covered, meaning the broker may not have the basis, so you are responsible for it. Always check the 1099-B against your own records. This is general information, not tax advice.

What is stepped-up basis on inherited stock?

When you inherit shares, your cost basis is generally reset, or stepped up, to the market value on the date of the original owner's death rather than what they originally paid. This can erase a large unrealized gain for the heir. Gifted shares are different: you usually take the giver's original basis. These rules are intricate and situation-specific, so confirm the details with a tax professional. This is general information, not tax advice.

Does Walnut track my cost basis?

Walnut is not a registered investment adviser or a tax adviser and is not the official record of your basis; your brokerage and its Form 1099-B are. Walnut can read your connected accounts so you can see, in plain words, how each holding has moved and get context on your positions, but it does not calculate your tax or tell you which lots to sell. For basis questions and lot selection, rely on your broker's records and a qualified tax professional.

From here, see how basis sets your bill in capital gains tax, how lot choice powers tax-loss harvesting, and the broader picture in how stocks are taxed.

Walnut is informational and is not a registered investment adviser or a tax adviser. This page explains cost basis in general; it is not a recommendation to buy, sell, or hold any security, and it is not tax advice. Investing involves risk, including the possible loss of principal, and past performance does not indicate future results. Tax rules, reporting requirements, and basis rules change and depend on your individual circumstances; verify current details with the IRS or a licensed professional before making any decision. Do your own research or consult a licensed financial or tax professional.

Related articles

    What Is Cost Basis? How It Sets Your Taxable Gain (2026), Walnut