Why is our invoice out by a few pence and nobody can explain it?
Your website and ERP round VAT at different points, so a price stored to two decimals drifts by pennies per order. Here's the arithmetic and the fix.
Your website and your ERP are both doing the sums correctly. They round at different points, usually around VAT. One stores the ex-VAT price rounded to two decimal places; the other starts from the inclusive price and strips VAT at the end. Multiply by a quantity and a gap appears, different on every order, so nobody can pin it down.
We covered this in episode 2 of The questions we ask. This is the long version, with the arithmetic laid out so you can check it against your own orders.
The symptom is small and never the same twice
Someone in accounts notices that a web order and its invoice don't agree. It's 4p on one order and £3.80 on the next. They raise it, the website team pull the order, check every line and find nothing wrong. The ticket closes.
A month later it's back with a different number.
Over time it settles into a standing argument. Accounts say the website is wrong, the website team say the ERP is wrong, and both are right about their own arithmetic. Most businesses we see end up with a small write-off code and a quiet agreement not to look too closely.
The arithmetic behind the gap
Take a product sold at £10.00 including VAT at 20%. Divide by 1.2 and the ex-VAT price is £8.3333, with the 3s running on forever.
The ERP holds the £10.00 inclusive price. The website stores the ex-VAT price to two decimal places, so it keeps £8.33. On the product page it adds VAT back (£8.33 × 1.2 = £9.996), rounds for display and shows £10.00. For one unit, everything looks right.
Now order ten:
| Website | ERP | |
|---|---|---|
| Net | 10 × £8.33 = £83.30 | £83.33 |
| VAT | £16.66 | £16.67 |
| Total | £99.96 | £100.00 |
That's 4p. Order a thousand and the website comes to £8,330.00 plus £1,666.00 VAT, so £9,996.00. The ERP takes 1,000 × £10.00 = £10,000.00 and strips the VAT out of that (£8,333.33 net, £1,666.67 VAT). The gap is now £4.00.
Neither system has made a mistake. The website rounded once, at the moment it stored the price, and the third of a penny it threw away comes back multiplied by every unit sold.
The second version of the problem is in unit prices that need four or five decimal places. Fixings and other parts sold by the thousand often carry prices like £0.01845 each. Squeeze that into two decimal places and the website holds £0.02. Rounding to two places can move a unit price by up to half a penny, which on a 10,000-unit order is up to £50 in either direction. In this example it's £15.50.
We once worked with a fixings supplier whose month-end never balanced. We traced it to a single nail: one product, priced to four decimal places in the ERP, carried to two on the website, and ordered in the thousands most weeks.
Why it looks different on every order
The size of the gap depends on three things at once. Quantity scales it. Each product carries its own rounding remainder, some rounded up and some down, so a mixed basket partly cancels itself out. And an order with standard-rated, reduced-rate and zero-rated lines rounds each rate's VAT separately.
So a five-line order can come out exact, and the next one can be 3p out the other way. It looks random, which is why it gets treated as noise.
Every gap is reproducible, though, once you know where each system rounds. That's the part worth finding out.

Rounding can happen in three places
The first is the line. VAT is worked out for each line, rounded to the penny, and the lines are added up. Each line looks tidy on the invoice, but the total VAT can drift a penny or two from the VAT you'd get on the order total.
Basket-level rounding works out the net total for each VAT rate and calculates VAT once per rate. The total is closer to the true figure, though the VAT shown against individual lines won't add up to it exactly.
Then there's the invoice. Many ERPs recalculate when they raise the invoice, which can happen after dispatch and across part-shipments. Two shipments means two roundings, so an order that matched at checkout can stop matching when it's invoiced.
Moving the rounding point moves where the pennies land. HMRC guidance (VAT Notice 700, section 17.5, and the VAT Trader Records manual) allows VAT to be calculated at line or invoice level and sets out more than one acceptable rounding method, with tighter rules on rounding down for businesses that sell to consumers at VAT-inclusive prices [verify]. Any permitted method is fine on its own. The trouble starts when the website and the ERP each pick a different permitted method for the same order. Choose one, write it down, and make both systems follow it.
Pick a master for price and give it a precision rule
For most mid-market businesses the ERP is the master for price, and the website receives prices through an integration. That's sensible. The weak spot is the assumption that copying a number across is enough.
"The website shows what the ERP holds" needs three more details before it means anything: whether the price is held with or without VAT, how many decimal places it carries, and where rounding happens.
Our rule is to hold the price in the form you set it. If your trade price list is set ex VAT, the master holds exclusive prices. If you sell to consumers at £10.00 and £24.99, the master holds inclusive prices, and the ex-VAT figure is calculated at full precision whenever it's needed and never stored rounded. If you sell both ways, derive both from one master figure and round only once, at the end.
Precision catches out other parts of the order
Currency conversion has the same weakness. Exchange rates carry four to six decimal places; apply one to a price that's already been rounded and you compound the error. Convert from the full-precision base price and round once.
Units of measure catch people out too. A box of 200 fixings at £8.99 works out at £0.04495 each. That's fine while you only sell the box. Allow customers to buy loose and two decimal places won't hold the unit price.
Discounts are the third. A 15% discount applied to a stored £8.33 gives a different answer from 15% off £10.00 inclusive, and it compounds across quantity in the same way. There's enough in discounts for a post of its own, so we've written one: how discounts break your totals [link to Blog 11].
How to check your own site
Start with a VAT-inclusive price that doesn't divide cleanly by 1.2. £10.00 works, as does most anything ending in a 9.
Find out what your website stores for that product. The admin screen may show a rounded figure, so ask your IT lead for the value held in the database or in a product export. If it's held ex VAT to two decimal places, you've probably found your gap.
Then put a large quantity through checkout on a test or staging site and compare the total with what your ERP would invoice for the same order. A thousand units makes the difference easy to see.
Last, find out whether each system rounds VAT line by line or once on the total. Your accounts package documentation or your ERP partner will know for the ERP side.
Questions to ask your agency or platform
You don't need to know how the code works to get a useful answer. These three questions will usually surface the problem:
- Do you store our prices with VAT or without it?
- How many decimal places does a price carry in the database, as opposed to on screen?
- Where does the rounding happen: on each line, on the basket total, or on the invoice? And does that match what our ERP does?
Ask for the answers in writing. If two people give you different answers, you've learnt something useful already.
Tracing it to the source
If the gap is a recurring line in your month-end, it's worth tracing a price from the master record through to the invoice and writing down every point where it gets rounded. That's the sort of work we do in Discovery, before anyone changes any code. It's also the sort of discrepancy a buyer's technical due diligence tends to pick up, and it's a far easier conversation if you found it first. Talk to us about Discovery.