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
Learn the method
Inputs
- Lot matching method
FIFO — oldest lot first / LIFO — newest lot first / HIFO — highest cost per share first / Specific ID — lots named on the sell line
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.