UK VAT Validator
Online UK corporate VAT validator. Ideal for integration and software QA.
How does VAT validation work?
Validation checks if the 9-digit string matches the positional weights from 8 to 2 on the first 7 base digits.
If the accumulated weighted sum plus the final two check digits of the VAT is divisible by 97 (or if adding 55 to the sum, it is divisible by 97), the document is valid.
Anatomy & Structure of UK VAT (9 Digits)
The UK VAT registration number issued by HMRC features 3 structural components:
| Position | Field | Length | Meaning & Rule | Example |
|---|---|---|---|---|
| Prefix | Country Code | 2 letters | Optional ISO "GB" prefix for cross-border trade | GB |
| 1 to 7 | Base Number | 7 digits | Sequential business registration number with HMRC | 1234567 |
| 8 & 9 | Check Digits | 2 digits | Two-digit checksum computed via Modulo 97 (standard or +55) | 89 |
UK VAT Validation Algorithm (Standard & Alternative Modulo 97)
HMRC verifies the final 2 digits using positional weights from 8 down to 2:
(Sum + CheckDigits) % 97 == 0 || (Sum + 55 + CheckDigits) % 97 == 0
- 1. Extract the first 7 base digits.
- 2. Multiply each digit by position weights: [8, 7, 6, 5, 4, 3, 2] and calculate total Sum.
- 3. Standard Check: verify if (Sum + CheckDigits) % 97 == 0.
- 4. Alternative Check (+55): verify if (Sum + 55 + CheckDigits) % 97 == 0.
- 5. The VAT number is valid if either standard or alternative rule succeeds.