Mathproven

Cost per mile calculator

Type what it cost to run a truck or a small fleet for a period you name, one line per cost, each marked fixed or variable, and the miles driven in that period. The page divides each line, each subtotal, and the total by the miles and shows the cost per mile to a tenth of a cent. With the revenue for the same period typed in, it also shows revenue per mile and what is left per mile after costs. It holds no rates and no averages of its own: every figure comes from what you type.

What you type stays in your browser on this device. Nothing is uploaded.

Total cost for the periodFixed costsVariable costsFixed plus variable equals total cost
Total cost for a period, cut into fixed and variable, each divided by the miles.
1. The period and the miles

Miles take up to 3 decimal places. With revenue typed, the result also shows revenue per mile and what is left per mile after costs.

2. Costs for the same period

One line per cost, each marked fixed or variable. The names below are only a starting list: rename them, remove them, or add lines. A line with no amount is left out. Amounts are dollars and cents, zero or more. A credit is not typed as a minus amount: it is taken off the cost it belongs to, and that cost is typed as the smaller amount.

CostFixed or variableAmount

The page divides the costs typed by the miles typed. It holds no rates and no averages, and it does not say what a mile ought to cost, what a load is worth, or what belongs on a tax form. Fuel dollars for a period can be added up from a fuel-card statement with the fuel-card ledger.

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. Name the period and type the miles. Type the miles driven in the period, with up to 3 decimal places. A name for the period, such as a month or a quarter, is optional and is printed on the result.
  2. Type each cost and mark it fixed or variable. One line per cost for the same period. The page starts with a few common names and blank amounts; rename them, remove them, or add lines. A line with no amount is left out. Amounts are dollars and cents, zero or more: a credit is typed by taking it off the cost it belongs to. Which costs are fixed and which are variable is marked by you, and the page adds up the two groups as marked.
  3. Read the cost per mile. Each line, each subtotal, and the total are divided by the miles and rounded to a tenth of a cent, with an exact half rounded away from zero. The subtotals and the total are divided from their own dollars, not made by adding rounded lines, so the lines can add up to a few tenths of a cent more or less than the total.
  4. Add revenue, and export. Type the revenue for the same period to see revenue per mile and what is left per mile after costs. The certificate lists every check. Download Excel or CSV, or print.

Worked example

A made-up month, March 2026, for one truck: eight costs, 10,000 miles driven, and $19,254.00 of revenue.

CostFixed or variableAmountPer mile
Truck paymentFixed$2,156.00$0.216
InsuranceFixed$1,187.00$0.119
Permits and platesFixed$166.00$0.017
Fixed costs$3,509.00$0.351
FuelVariable$5,538.00$0.554
Maintenance and repairsVariable$746.00$0.075
TiresVariable$317.00$0.032
TollsVariable$128.50$0.013
Driver payVariable$4,600.00$0.460
Variable costs$11,329.50$1.133
Total cost$14,838.50$1.484
Revenue$19,254.00$1.925
Left after costs$4,415.50$0.442

Every figure is its own dollars divided by the 10,000 miles and rounded to a tenth of a cent. The fixed subtotal is $3,509.00 ÷ 10,000 = $0.3509, shown as $0.351, while its three lines, each rounded on its own, add up to $0.352. In the same way the eight rounded lines add up to $1.486 and the total cost per mile is $1.484: the difference of $0.002 is rounding, and it is inside the half of a tenth of a cent per line ($0.004 for eight lines) that the check allows. What is left per mile is $4,415.50 ÷ 10,000 = $0.44155, shown as $0.442; taking one rounded figure from the other, $1.925 − $1.484, would give $0.441.

The example uses made-up names and numbers.

Questions

How is cost per mile calculated?

Each cost for the period is divided by the miles driven in the same period. A cost of $5,538.00 over 10,000 miles is $0.5538 a mile, shown as $0.554. The fixed subtotal, the variable subtotal, and the total are each divided the same way from their own dollars.

What is the difference between fixed and variable on this page?

Only which subtotal a line is added into. The lines marked fixed go into one subtotal and the lines marked variable into the other, and each subtotal is divided by the miles. The page does not decide which costs are fixed and which are variable; every line is marked by the person typing it.

Why do the lines not add up to the total cost per mile?

Each line is rounded on its own to a tenth of a cent, and the total cost per mile is the total dollars divided by the miles, rounded once. The lines added up can therefore be a few tenths of a cent more or less than the total. The certificate prints both figures and how far apart rounding allows them to be, which is half of a tenth of a cent per line.

How is rounding done?

Every per-mile figure is rounded to a tenth of a cent, which is three decimal places of a dollar, and an exact half rounds away from zero. Amounts are kept in whole cents and miles in whole thousandths, so nothing drifts.

What does left per mile after costs mean?

Revenue for the period minus total cost for the same period, divided by the miles. It is worked from the dollars, not by taking the rounded cost per mile from the rounded revenue per mile, so it can differ from that subtraction by a tenth of a cent. It counts only the costs typed on the page.

Can a credit or a rebate be typed as a minus amount?

No. Amounts are zero or more. A credit is typed by taking it off the cost it belongs to, so that cost goes in as the smaller amount.

Does the page say what rate to charge or what a normal cost per mile is?

No. It holds no rates, no averages, and no figures to compare with. It divides the costs typed by the miles typed and proves the arithmetic. It makes no statement about what a load is worth or about what belongs on a tax form.

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