Synthetic Industry

Free tool · updated 2026-10-11

Invoice rounding bench: compare per-line and total rounding, half-up and half-even

Enter invoice lines and see net, tax and gross under four rounding rules side by side, in exact whole-number minor units, with the difference between summing lines and rounding the total. Not tax or accounting advice.

What it computes

Enter one or more invoice lines (quantity, unit price and tax rate in percent), pick the number of minor-unit digits your currency has, and choose the rounding rule you want to compare against. The tool calculates net, tax and gross under four rules and shows them side by side, flags every figure that differs from your chosen rule, and reports 'line sum minus total': how far apart summing rounded lines and rounding once on the total are, in minor units (pence, cents). It also shows the exact, unrounded figures and which lines land on an exact half.

Example values are loaded when the page opens so the difference is visible straight away. Replace them with your own. Nothing you enter is sent or stored.

  • Round each line: the line net (quantity times unit price) is rounded to a whole minor unit, tax is calculated on that rounded net and rounded again, and the invoice totals are the sums of the rounded lines.
  • Round once on the total: exact line amounts are added up unrounded, then the invoice net and the invoice tax are each rounded once; gross is rounded net plus rounded tax.
  • Half-up rounds an exact half away from zero (0.5 to 1, -0.5 to -1). Half-even rounds an exact half to the even neighbour (0.5 to 0, 1.5 to 2, 2.5 to 2); the two differ only on exact halves.
  • Negative quantities or prices are treated as credit lines and round symmetrically.

A worked example you can check by hand

Three invented lines, each quantity 1, unit price 0.03 and tax rate 20%, in a currency whose minor unit is 0.01. Each line's exact tax is 0.006, which is 0.6 of a minor unit. Rounding each line gives 1 minor unit of tax per line, so 3 in total. Adding the exact tax first gives 1.8 minor units, which rounds to 2. The two rules disagree by one minor unit of tax and so of gross. A second example: one line at 0.50 with 5% tax has exact tax of 2.5 minor units, an exact half, so half-up gives 3 and half-even gives 2.

Both figures are arithmetic on invented numbers. They are not a recommendation to apply that rate or that rounding rule to any real supply.

  • With 500 identical copies of the first line, summing rounded lines gives 5.00 of tax and rounding the total once gives 3.00, a gap of 2.00: the difference grows with the number of lines.
  • Which rule is right depends on your accounting system, your invoice format and the tax rules that apply to you; this tool does not decide that.

If the matrix is wider than the box, scroll horizontally to read every column. Keyboard: focus the matrix and use Left/Right.

Net  0.09 (3 x 0.03) at 20%: exact tax 0.018, exact gross 0.108

Rule                                Net    Tax    Gross
Round each line, half-up            0.09   0.03   0.12
Round each line, half-even          0.09   0.03   0.12
Round once on the total, half-up    0.09   0.02   0.11
Round once on the total, half-even  0.09   0.02   0.11

Line sum minus total: tax +1 minor unit, gross +1 minor unit

Assumptions and the arithmetic

Every value is read as decimal text and scaled to a whole number: quantity, unit price and tax rate may each have up to four decimal places, up to fifteen digits before the decimal point, and the tool uses exact integer arithmetic throughout, so there is no floating-point drift. Sub-minor-unit prices such as 0.0125 are exact. Use a full stop as the decimal separator and no thousands separators: a comma is refused rather than guessed. Tax rates must be from 0 to 100 percent.

  • One tax rate per line; no discounts, shipping, tax-inclusive prices or currency conversion.
  • Some systems round tax per rate group, per line on the gross amount, or only at the invoice level; check which one yours uses before relying on any column.
  • Up to 500 lines can be calculated; the page offers 100.

What it cannot tell you

It is not tax or accounting advice and does not know which jurisdiction, invoice type or accounting system you use. Accounting systems differ in where they round, and it cannot reproduce a specific product's behaviour. If your destination total differs from your source total, this tool can show whether a rounding rule alone could explain the gap, but a gap larger than the spread it shows has another cause, such as an amount entered as tax-inclusive that was treated as tax-exclusive. For that, see the invoice tax amount basis guide and the synthetic reconciliation example linked on this page.

If an agreed column is missing from a Sheets-to-Xero mapping, the related outcome is to send every mapped Google Sheets invoice field to Xero using one disposable test row. That outcome does not include fixing tax configuration or historical invoices.

  • A one-unit tolerance can hide a real policy mismatch; agree the policy first.
  • Nothing here is a quote or an offer to fix an invoice integration.

Use the tool

Sources and limits

  • Rounding bench implementation Checked 2026-10-11.
    • Quantity, unit price and tax rate are read as decimal text and scaled to whole-number integers; no floating-point value is used in any money calculation.
    • Four rules are computed: round each line or round once on the total, each with half-up or half-even rounding of exact ties.
    • Results are checked in the tool's test suite against an independent exact-fraction implementation over 400 seeded random invoices.
  • Python decimal module: rounding modes Checked 2026-10-11.
    • ROUND_HALF_UP rounds to nearest with ties going away from zero.
    • ROUND_HALF_EVEN rounds to nearest with ties going to the nearest even integer.