Wealthy Habitat

Library · taxes · Published 10/13/2026 · Re-read against its sources 10/13/2026

cost basis methods: FIFO, specific ID, and average cost

The method you use to match purchase prices to shares you sell can change your taxable gain and your tax bill.

In short

A friend of mine once sold some shares and said, "I made a killing," only to learn the tax bill told a different story. If you are holding the same stock you bought on several different days, the price you paid for each batch matters a great deal. That price is called your cost basis, and the method you use to match it to a sale can change your taxable gain. The default method for most stock is first in, first out, called FIFO. You can often pick specific identification instead, but the broker generally needs your instruction before the trade settles. Mutual fund shares can use average cost, which blends all your purchases into one price. Your broker reports basis to the IRS on Form 1099-B, so you will want to know which method it applies for you.

The whole of it

What it is

I once watched a neighbor empty a coffee can of receipts onto his kitchen table, trying to remember what he paid for a stock he bought over ten years. He laughed and said, "I'm a better saver than a bookkeeper." Most of us are.

Cost basis is simply what you paid for an investment, including fees you paid to buy it. When you sell, your gain or loss is the sale price minus that basis. If you paid $4,000 for shares and sold them for $5,500, your gain is $1,500. The IRS taxes the gain, not the whole sale.

Trouble starts when you bought the same stock more than once. Say you bought 10 shares in March at $40 and 10 more in September at $60. When you sell 10 shares, which batch did you sell? The answer is not obvious, so the tax rules give you a few ways to decide. Those ways are called cost basis methods, and the three that matter most are FIFO, specific identification, and average cost.

Each one is a rule for deciding which purchase price gets matched to the shares you sold. The shares are identical. Only the paper trail changes. And the paper trail decides your tax.

How it works

If you have ever stood in a grocery line and wondered which can on the shelf was the oldest, you already grasp the first method. FIFO means first in, first out. The shares you bought earliest are treated as the first ones sold. The IRS describes this as the default in Publication 550, Investment Income and Expenses, when you cannot identify which shares you sold. So if you say nothing, FIFO is what happens.

Specific identification is the second method, and it puts you in the driver's seat. You tell the broker exactly which lot to sell, meaning which batch, by purchase date and price. Treasury rules on this, found in the regulations under Section 1012 of the Internal Revenue Code, call for you to identify the shares at the time of the sale. Brokers generally want that instruction in hand by the trade date. A note you scribble a month later usually will not do.

Why would anyone choose a lot? Because the batches carry different prices. Selling a high basis lot makes a smaller gain, and selling a low basis lot makes a bigger one. The holding time matters too, since a sale of shares held one year or less is a short term sale and is taxed differently from a long term sale. Choosing a lot is a way to see all of that before you click sell.

Average cost is the third method, and it is narrower. It is allowed for mutual fund shares and certain dividend reinvestment plans, not for ordinary stock. The broker adds up everything you paid for all your fund shares, divides by the number of shares, and uses that single price for every sale. It is simple. It is also less flexible, since you give up the lot picking.

One more point. Once you choose average cost for a fund, the rules in Publication 550 say you stay with it for that fund until you sell all your shares in it, with some room to change under IRS procedures. So the choice has some weight to it.

The numbers, and where to find yours

You have probably opened a brokerage statement and felt your eyes glaze over. Let me point you to the two places that matter. The first is your trade confirmation, which lists the date, price, and quantity of each purchase. The second is Form 1099-B, which your broker sends after year end. It shows the proceeds from each sale and, for most shares bought in recent years, the cost basis the broker calculated.

The law requires brokers to report basis for stock bought on or after a certain date, and for funds from a later date. Those dates were set by Congress, and the IRS explains them in the instructions for Form 1099-B. For older shares, the basis box may be blank, and then the records you kept are what count.

Your gain or loss lands on Form 8949, and the totals flow to Schedule D. The IRS instructions for both forms walk through each box. The tax rate on a long term gain depends on your income, and the brackets change by year, so check the the current figure, which the official source publishes each year on the IRS site rather than trusting a number from memory. The same goes for the the current figure, which the official source publishes each year, which can add a tax for higher earners.

Most brokers let you set a default method in your account settings. Look for words like tax lot method or cost basis election. It takes a minute, and it saves a headache.

A worked example

Let me tell you about Marcus, a schoolteacher who likes to keep things tidy. He bought 100 shares of one company in three batches. In February he bought 40 shares at $20 a share, which cost $800. In June he bought 30 shares at $30 a share, which cost $900. In November he bought 30 shares at $50 a share, which cost $1,500.

Two years later the stock trades at $60, and Marcus sells 50 shares. The sale brings in 50 shares at $60, which is $3,000. Now watch what each method does with the very same sale.

Under FIFO, the earliest shares go first. That is all 40 February shares plus 10 of the June shares. The February basis is 40 shares at $20, which is $800. The June piece is 10 shares at $30, which is $300. Total basis is $800 plus $300, which is $1,100. His gain is $3,000 minus $1,100, which is $1,900.

Under specific identification, Marcus picks the priciest batch. He names the 30 November shares at $50, which is $1,500, plus 20 June shares at $30, which is $600. Total basis is $1,500 plus $600, which is $2,100. His gain is $3,000 minus $2,100, which is $900.

Under average cost, which would apply only if these were fund shares, the math is different again. All three batches cost $800 plus $900 plus $1,500, which is $3,200, spread over 100 shares. That is $32 a share. Selling 50 shares gives a basis of 50 shares at $32, which is $1,600. His gain is $3,000 minus $1,600, which is $1,400.

Same shares, same sale, three gains: $1,900, $900, and $1,400. That is a gap of $1,000 from the method alone. Marcus did not change what he owns. He only changed which receipt he pointed to. If he held the shares long enough, the gain would be taxed at the long term rate, and if not, at the short term rate, so the dates matter as much as the dollars.

Where it goes wrong

I have a soft spot for people who do things the honest way and still get tripped up, because it happens to the best of us. The first trap is silence. If the borrower of a method, meaning the investor, never tells the broker which lot to sell, FIFO applies, and it may not be the method that serves the person best. By then the trade has settled, and the choice is usually gone.

The second trap is a mismatched record. The broker's 1099-B may show one basis while your own notes show another, perhaps because of shares you inherited, received as a gift, or moved from another firm. Basis for those shares follows special rules, and the broker may not know your original price. Sorting that out is the taxpayer's job. The IRS wants the correct figure on Form 8949, even if the 1099-B is off.

The third trap is the wash sale. Publication 550 explains the wash sale rule in plain terms. In short, the rule can disallow a loss when the seller buys the same or a substantially identical security close to the date of the sale, and the page spells out the exact window and how the basis is adjusted. It can quietly undo a plan built on picking lots.

The fourth trap is mixing methods across accounts. The same stock held at two brokers can be treated two ways, and each firm reports only its own side. Keep your own file. Count the lots.

Last, remember that a lower tax today is not the same as a better outcome. Picking the highest basis lot trims this year's gain but leaves lower basis shares behind, which means a bigger gain later. The tax is postponed, not erased. That may suit you or it may not.

Questions to answer before you leave this page

Do you know which cost basis method your broker applies if you give no instruction, and have you looked at that setting in your account? When you last sold shares, could you name the lot you sold, or did the default decide for you? Do you hold any mutual fund shares where average cost might already be in use, and did you choose it on purpose? Have you checked that the basis on your last Form 1099-B matches your own records for every lot, especially any shares you inherited or were given? Do you keep trade confirmations somewhere you can find them in ten minutes instead of ten days? If you sold shares at a loss, did you buy the same stock within 30 days before or after the sale? And what would you want to know before your next sale, such as the dates, the prices, and the tax rate that applies to the gain?

Sources

irs.gov · read 10/13/2026
irs.gov · read 10/13/2026
irs.gov · read 10/13/2026
irs.gov · read 10/13/2026

Each figure on this page was found, word for word, on the official page beside it, on the date shown, and is read again on a schedule. A figure that changes on its page comes down until the page is rewritten.

Related

how to read a brokerage statement
capital gains rate brackets
net investment income tax threshold
charitable giving with appreciated stock

Was this useful? Counted, never signed.

Ask about this guide

A model reads this page and answers from it. It will say when the answer is not on the page. Education, not personalized advice.

Written by the site's growth engine and checked by its gates: voice, law and ethics, facts, arithmetic, and sources. Not yet read by a human editor; every page carries the correction process. Rules and dollar limits change every year; figures come from the rules table with their source and date.