Mathproven

Exchange CSV to capital gains worksheet

Open the export of your buys and sales and pick the lot method and how fees are handled. Each sale is matched to the lots it came from, giving the acquired date, disposed date, quantity, proceeds, cost basis, and gain or loss per row. Only rows typed as a buy or a sale are used: transfers, rewards, and conversions or swaps of one coin into another are listed and counted, not matched. Lots are pooled per asset across every account or wallet in the file. Quantities are whole units of 0.00000001 and money is whole cents, so nothing drifts.

The export is read in your browser and stays on this device. Nothing is uploaded.

Lot engine=Second lot engineQuantity, basis, and proceeds conserved
Two lot engines work the same buys and sales and have to agree.
1. Your exchange export

The file is read in this browser and is not uploaded.

This is a worksheet of your own trades under the method you picked. It is not a tax form and is not in any agency's form layout.

What gets checked

Your numbersThe mathThe checksVerifiedNot verified
A result that fails a check is marked not verified. It is never shown as correct.

How it works

  1. Open your export. Drop the transaction export (.csv or .xlsx) with buys and sales. It is read in the browser.
  2. Check the column mapping. Date and time, type, asset, quantity, total cost or proceeds, and fee are matched from the header words and can be changed. Rows that are neither a buy nor a sale (transfers, rewards, conversions or swaps) are not used; each is listed with its row number and counted in a warning on the certificate.
  3. Pick the method and the fee rule. First in, first out takes the oldest lot; highest cost first takes the lot with the highest cost per unit. Fees are either added to cost and subtracted from proceeds, or left out. Neither choice is made for you.
  4. Review and export. The worksheet, any sales larger than the holdings, the lots still held, and the verification certificate are shown. Download Excel or CSV, or print.

Worked example

A made-up export: buy 1 BTC for $30,000.00 with a $30.00 fee on January 5, buy 0.5 BTC for $20,000.00 with a $20.00 fee on February 10, sell 0.3 BTC for $15,000.00 with a $15.00 fee on March 15, and sell 0.9 BTC for $36,000.00 with a $36.00 fee on April 20. Method: first in, first out. Fees added to cost and subtracted from proceeds.

QuantityDate acquiredDate disposedProceedsCost basisGain or loss
0.32026-01-052026-03-15$14,985.00$9,009.00$5,976.00
0.72026-01-052026-04-20$27,972.00$21,021.00$6,951.00
0.22026-02-102026-04-20$7,992.00$8,008.00-$16.00

Proceeds $50,949.00, cost basis $38,038.00, gain $12,911.00. The 0.3 BTC still held carries $12,012.00 of basis, and $38,038.00 + $12,012.00 = $50,050.00, the total cost of both buys with fees. With highest cost first on the same export, cost basis is $41,041.00 and the gain is $9,908.00.

The example uses made-up names and numbers.

Questions

Which method does the tool use?

The one you pick. It offers first in, first out and highest cost first, and it does not pick one or say which applies to you.

How is a partial lot's cost worked out?

Cost taken is the lot's cost times the quantity taken divided by the lot's quantity, rounded half away from zero to the cent, in whole-number math. What is not taken stays with the lot, so a lot's pieces always re-add to its cost exactly.

What if I sold more than the export shows I bought?

The part of the sale with no lot is listed by row with its quantity and the part of the proceeds that goes with it, and the worksheet is marked not verified. It is never treated as having a zero cost basis. This usually means coins came in from somewhere the export does not cover.

Does it keep accounts or wallets apart?

No. Lots are pooled per asset across every account or wallet in the file, and the account column is not used when a sale is matched to a lot. When the file names more than one account, a warning on the certificate says so and names them.

What about conversions, swaps, transfers, and rewards?

They are not used. Only rows whose type reads as a buy or a sale become lots or sales. Every other row is listed with its row number and type and counted in a warning on the certificate, so a sale of coins that arrived by transfer or conversion shows up as larger than the holdings.

How is the worksheet checked?

Twice over. A second lot engine, written a different way, works one asset at a time and computes the cost that stays in each lot instead of the cost taken; it must agree with the worksheet on every lot of every sale and on what is left. Then each row is tested on its own, without division: its cost against its own lot, its proceeds against its own sale, and its dates against the buy and the sale it points at.

Is this a tax form?

No. It is a worksheet of your own trades in its own layout. It is not an agency form and it does not say what to report.

This tool calculates and checks numbers. It is not legal, tax, or medical advice.