FAILURE MAP
← Case archive

FA-72702 / Check-digit algorithms / Member archive

UK VAT reads only the last check digit · case 02

Most valid VAT numbers are rejected.

Member previewVariant 2 · 3 implementations · 8 checks per implementation

Case contract

UK VAT registration number check. Spaces are removed, the text is upper-cased and an optional GB prefix removed; the rest must be 9 ASCII digits (else "malformed"). Weights 8..2 apply to the first seven digits; the last two digits form a number c. Return "mod97" if (sum + c) is divisible by 97, "mod9755" if (sum + c + 55) is, else "invalid".

Why this case matters

Invoice processing screens supplier VAT numbers before reclaiming input tax.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression ["GB 029 3313 90"]"invalid""mod97"Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗