TheBiz99

Crypto Cost Basis & Partial Sale Calculator

Match a partial sale to purchase lots using FIFO and export a CSV breakdown.

Initial values are examples. Enter your own values; results update immediately.

View result ↓

Currency changes do not convert numbers. Examples replace inputs only after confirmation.

Purchase lots

Use one asset in one account. Fees are quote-currency amounts, not coin units. Equal timestamps use purchase entry order.

Purchase 1
Purchase fee · USD 30.00000000
Purchase 2
Purchase fee · USD 40.00000000

Partial sale

After sale fees and cost basis, your estimated profit is USD 24,875.00.

FIFO results

This calculates transaction cost basis and profit, not country-specific tax.

Realized profit / loss
USD 24,875.00
Cost basis of units sold
USD 50,050.00
Net sale proceeds
USD 74,925.00
Units remaining
0.5 BTC
Remaining cost basis
USD 20,020.00
Break-even unit sale price including FIFO basis and sale fee
USD 33,416.66666667

After the sale, you hold 0.5 BTC with a remaining cost basis of USD 20,020.00000000.

Summary amounts use currency rounding. Lot details retain 8 decimal places; CSV retains internal calculation precision.

View FIFO allocation and remaining lots

Scroll horizontally for all detail columns; key results appear above.

FIFO allocation by purchase lot
LotUnits soldAllocated basisAllocated sale feeRealized P/LUnits leftRemaining basis
1 · 2026-01-01T12:001USD 30,030.00000000USD 50.00000000USD 19,920.000000000USD 0.00000000
2 · 2026-02-01T12:000.5USD 20,020.00000000USD 25.00000000USD 4,955.000000000.5USD 20,020.00000000
View calculation results ↓

Trace a partial sale back to the lots it consumes

Global · Year-independent / dated user inputs · Rules reviewed 2026-11-12 · Rule revision 2026-11-12.1

Crypto holders reconciling a partial sale in a single account.

Independently checked examples · These fixed case studies do not change with your inputs above.

Inputs and preparation

Enter every purchase date, quantity, unit price and total quote-currency fee, then one sale. Use UTC and only one asset/account.

Enter each acquisition as its own dated lot with quantity, unit price and buy fee. Keep all money in the same currency. The sale must occur after the acquisitions used to cover it; an asset ticker does not fetch prices, identify wallets or reconcile transfers.

Formula

Lot basis = (units × unit price + purchase fee) × sold units / purchased units. FIFO consumes the earliest lots first. Net sale proceeds = units sold × sale price − sale fee. P/L = net proceeds − allocated basis.

Worked examples and comparisons

Partial sales consume the earliest lots

Illustrative BTC trades in USD: buy 1 on 2026-01-01 at 30,000 plus fee 30; buy 1 on 2026-02-01 at 40,000 plus fee 40. Sell on 2026-03-01. These prices are invented examples, not historical quotes.

Partial sales consume the earliest lots
Sale quantity / unit price / feeAllocated basisRealized P/LRemaining quantityRemaining basis
0.5 / USD 50,000.00 / USD 25.00USD 15,015.00USD 9,960.001.5USD 55,055.00
1.5 / USD 50,000.00 / USD 75.00USD 50,050.00USD 24,875.000.5USD 20,020.00
2 / USD 35,000.00 / USD 70.00USD 70,070.00USD -140.000.0USD 0.00
2.1 (held 2)Rejected: oversellNo resultNo resultNo result

What the comparison tells you

The hypothetical BTC lots are one unit at USD 30,000 plus a USD 30 fee and one at USD 40,000 plus a USD 40 fee. Selling 0.5 uses half the first lot’s USD 30,030 basis. Selling 1.5 consumes that lot fully plus half the second. The dates and prices are fictional inputs, not historical market data.

Realized profit subtracts the allocated buy basis and the sale fee once. Remaining basis belongs to unsold units and is not another expense on the same sale. The 2.1-unit example is rejected because only two units are available; it must not create negative inventory or a profit result.

Scope and limitations

FIFO is the only supported identification method. This is a transaction-cost tool, not a country-specific tax calculation or filing statement. Broker-specific rules, wallet transfers, staking, swaps and fees paid in crypto are excluded. Amounts use 60 significant digits internally and inputs allow up to 18 decimal places.

This is a FIFO transaction-cost model only. It does not determine whether FIFO is legally appropriate for your jurisdiction, compute tax, or cover staking income, transfers, airdrops and every corporate action. Preserve original records and use the CSV as a calculation record, not a tax certificate.

Frequently asked questions

Can I sell more coins than I entered?

No. Add the missing qualifying purchase or reduce the sale quantity. Later purchases cannot fund an earlier sale.

Is FIFO always the correct tax method?

No. Permitted methods, account scope and broker identification rules depend on jurisdiction and circumstances. This tool only models FIFO.

What happens to rounding and fees in CSV?

CSV retains internal decimal results. A proportional share of purchase cost and sale fees is assigned to each consumed lot; summary values use currency rounding and detailed lot amounts retain 8 places.

Examples last reviewed: . Rule and fee effective dates are listed in this guide and the calculator. The review date is not the effective date of every rule.

Official references

Find another calculator

Find the right calculator

18 calculators

Crypto Cost Basis & Partial Sale CalculatorGlobal · Investing

Match a partial sale to purchase lots using FIFO and export a CSV breakdown.

eBay US Seller Profit & Risk SimulatorUnited States · Business

Estimate seller profit after your eBay fee rate, shipping, and other costs.

Balance Transfer vs. Personal Loan CalculatorUnited States · Debt

Compare promotional APR, transfer fees, and a personal loan using your budget.

Korean Take-Home Pay CalculatorSouth Korea · Tax & income

Estimate monthly net pay using 2026 Korean insurance and withholding rules.

Korean Freelance Withholding CalculatorSouth Korea · Tax & income

Calculate Korean business-income withholding and the amount you receive.

Korean Severance Pay & Retirement Tax CalculatorSouth Korea · Tax & income

Estimate eligible severance from wages, service duration, and work hours.

Freelance Hourly Rate CalculatorGlobal · Business

Find the billable hourly rate needed to cover income, costs, and time off.

Korean VAT Calculator for General TaxpayersSouth Korea · Tax & income

Estimate VAT payable or refundable from tax-exclusive sales and eligible purchases.

Break-Even Sales CalculatorGlobal · Business

Find how many units you must sell to cover fixed and variable costs.

Profit Margin & Markup CalculatorGlobal · Business

Compare selling price, cost, fees, profit margin, and markup.

Target Selling Price CalculatorGlobal · Business

Work backward from your target margin, shipping costs, and selling fees.

Investment Profit & Loss CalculatorGlobal · Investing

Calculate trade profit and ROI after buy and sell fees.

Overseas Stock Tax Calculator for Korean ResidentsSouth Korea · Tax & income

Estimate Korean tax on annual overseas stock gains after eligible costs and deduction.

Compound Interest CalculatorGlobal · Investing

Project investment growth with regular deposits and periodic compounding.

Loan Payment & Interest CalculatorGlobal · Debt

Compare equal-payment, equal-principal, and interest-only loan costs.

Early Loan Payoff CalculatorGlobal · Debt

Compare extra payments, prepayment fees, and time saved.

Credit Card Debt Payoff CalculatorGlobal · Debt

Estimate payoff time and interest for a fixed monthly payment.

Currency Conversion & Fee CalculatorGlobal · Currency

Estimate conversion costs using your quote or illustrative exchange rates.