gg
Home › Business & Trades › Tax Lot & Cost Basis Calculator
Business & Trades

Tax Lot & Cost Basis Calculator

Paste a list of buys, sells, reinvested dividends and splits, choose how sells should be matched to lots — FIFO, LIFO, HIFO or specific ID — and see what each sale actually realised. Every matched lot is shown with its acquisition date, the basis removed, the proceeds allocated to it, the gain or loss, and the exact number of days held, so you can check the short-term/long-term split rather than take it on faith. Splits adjust the share count and leave total basis alone, and the output proves it by printing the total before and after. All arithmetic is in whole cents on your device: basis taken out of a lot is subtracted from that lot, so the pieces always re-add to the whole and lot matching can never create or lose a cent. The result is a worksheet whose columns line up with the ones Form 8949 asks for — it is not the form and not a substitute for it, and you transcribe the figures yourself. It applies no tax rate and computes no tax. This is not tax advice.

Try it now

Worked example

TAX LOT & COST BASIS WORKSHEET Matching method: FIFO — oldest lot first Everything below is computed only from the transactions you pasted, in whole cents, on your own device. This is a worksheet, not tax advice, and it is not a tax return. It applies no tax rate and knows nothing about your other accounts, corporate actions it was not told about, or wash-sale adjustments. SPLITS APPLIED 2023-11-01 MSFT 2:1 — 2 open lot(s) adjusted. Total basis before $10,301.25 · after $10,301.25 (UNCHANGED, as a split must be) A split multiplies the share count and leaves total basis alone, so the basis per share falls by the same ratio. Fractional shares created by a ratio that does not divide evenly are rounded to six decimal places. REALISED — each sale, matched lot by lot 2024-03-10 SELL 150 AAPL at $25.00 — gross $3,750.00 − fee $0.00 = net proceeds $3,750.00 lot acquired shares basis proceeds gain held term L1 2023-01-10 100 $1,000.00 $2,500.00 +$1,500.00 425 LONG L3 2023-06-10 50 $1,000.00 $1,250.00 +$250.00 274 SHORT totals 150 $2,000.00 $3,750.00 +$1,750.00 2024-05-01 SELL 40 MSFT at $130.00 — gross $5,200.00 − fee $4.95 = net proceeds $5,195.05 lot acquired shares basis proceeds gain held term L2 2023-02-01 40 $4,001.98 $5,195.05 +$1,193.07 455 LONG totals 40 $4,001.98 $5,195.05 +$1,193.07 REALISED TOTALS Short term +$250.00 Long term +$2,693.07 Net +$2,943.07 Holding-period rule used: the holding period starts the DAY AFTER the shares were acquired and the day of sale counts. A sale is long term only when it happens AFTER the one-year anniversary of the acquisition date, so a sale ON that anniversary is short term. The "held" column above is the number of calendar days from the day after acquisition through the sale. OPEN LOTS REMAINING lot symbol acquired shares basis basis/share origin L2 MSFT 2023-02-01 60 $6,002.97 $100.05 buy · 1 split(s) applied L3 AAPL 2023-06-10 50 $1,000.00 $20.00 buy L4 MSFT 2023-08-01 2.469134 $296.30 $120.00 DRIP · 1 split(s) applied L5 AAPL 2023-09-10 100 $1,500.00 $15.00 buy Open basis $8,799.27 · basis removed by sales $6,001.98 · basis of every lot opened $14,801.25 Those three reconcile exactly: basis is taken out of a lot and the lot is reduced by the same number of cents, so lot matching can neither create nor lose a cent. WORKSHEET — the columns Form 8949 asks for This is NOT the IRS form and is not a substitute for it. It is a plain worksheet whose columns line up with the ones the form asks for, so you can transcribe the figures into the real form (or hand them to whoever prepares your return). Copy nothing blindly — check every row against your broker's own statement, which is the document the IRS also receives. term (a) description (b) acquired (c) sold (d) proceeds (e) cost basis (h) gain or loss LONG 100 AAPL 2023-01-10 2024-03-10 $2,500.00 $1,000.00 +$1,500.00 SHORT 50 AAPL 2023-06-10 2024-03-10 $1,250.00 $1,000.00 +$250.00 LONG 40 MSFT 2023-02-01 2024-05-01 $5,195.05 $4,001.98 +$1,193.07 Column (g), the adjustment column, is left off on purpose. Adjustments — wash-sale disallowances among them — are a judgement this tool does not make. Column (h) above is simply (d) − (e). WHAT THIS DOES NOT DO · It applies no tax rate, bracket, threshold or annual limit, and it computes no tax owed. It reports gain and loss only. · It makes no wash-sale adjustment. Use the Wash-Sale Flagger for a list of sales worth reviewing, and read that tool's limits before relying on it. · It does not know about return of capital, mergers, spin-offs, gifts, inheritance, options, short sales, or any basis adjustment your broker applied that is not in the lines you pasted. · It cannot see any of your other accounts. · Your broker reports basis to the IRS for covered securities. Where this worksheet and your broker disagree, find out why before you file. · This is not tax advice.

Learn the method

Inputs

Frequently asked

What format do the lines take?

date | action | symbol | quantity | price per share | fee | lots. The action is buy, sell, drip or split; on a split line the ratio (2:1, 3-for-2, 1:10 for a reverse split) goes where the quantity would. Fees are optional — a buy fee is added to basis, a sell fee is subtracted from proceeds. The last field is only read under Specific ID and lists the lot ids to use, like L2,L1. Separate fields with a pipe, semicolon or tab; a comma works on a line with no other separator. Dates may be 2024-01-15, 2024/01/15 or 01/15/2024, and lines may be in any order — they are sorted by date before matching.

What is the difference between FIFO, LIFO and HIFO?

They only change which open lots a sale consumes. FIFO takes the oldest lots first, LIFO the newest, HIFO the ones with the highest cost per share. The same sale can produce a very different realised gain under each — the tool prints the matched lots so you can see exactly which shares were used. Which methods you are permitted to use, and what your broker has on record, are questions for your broker and your preparer.

How is specific ID handled?

Each open lot is given an id — L1, L2 and so on, numbered in date order — and a sell line can name the ones it should use in the last field. Named lots are consumed in the order you list them; anything the sale still needs after that falls back to oldest-first, and the output says so. If you name a lot that does not exist, that is reported as a problem in the data.

How does it decide short term versus long term?

The holding period starts the day after the shares were acquired, and the day of sale counts. A sale is long term only when it happens after the one-year anniversary of the acquisition date — so a sale on the anniversary itself is short term, by one day. Every matched lot shows its holding-day count so you can check the boundary yourself.

What does a stock split do to my basis?

Nothing. A 2:1 split doubles the number of shares carrying the basis, so the basis per share halves while the total is unchanged. The tool prints the total basis before and after each split precisely so you can see that it did not move. Reverse splits work the same way in the other direction.

Are reinvested dividends handled?

Yes — a DRIP line is an ordinary purchase that opens its own lot, at its own price, with its own acquisition date and its own holding period. Fractional shares are kept to six decimal places rather than rounded to whole shares. Forgetting DRIP lots is one of the most common ways a basis figure ends up too low.

What happens if I sell more shares than I hold?

It is reported as a problem in the data, not silently absorbed. The sale matches every share that was actually open and the unmatched remainder is listed with the line number; no lot is ever taken negative. Usually it means a buy is missing from the paste.

Is this the IRS form?

No, and it deliberately does not imitate one. It is a plain worksheet whose columns correspond to the ones Form 8949 asks for — description, date acquired, date sold, proceeds, cost basis, gain or loss — so you can transcribe them into the real form or hand them to your preparer. The adjustment column is left off on purpose, because adjustments are a judgement this tool does not make.

Does it calculate my tax?

No. It contains no tax rate, no bracket, no threshold and no annual limit, and it never will. It reports realised gain and loss split by term, and stops there.

Does it account for wash sales?

No. Basis is not adjusted and no loss is deferred. The Wash-Sale Flagger is a separate tool that lists sales worth reviewing; read its limits before relying on it, because it can only see the symbols in the text you paste.

Related Business & Trades tools