VAT number formats by country
The national format of every EU and EFTA VAT number, so you can reject malformed input before you ever call a lookup service.
Format check first, lookup second
Every VAT number starts with a two-letter country code followed by the national body. The body has a fixed shape per country, so a format check catches obvious typos and test data instantly, with no upstream call. Existence checks (VIES or a national registry) are a separate, slower step that only makes sense after the format is right.
CodeCheck validates the format of all 31 countries below. Try one in the browser demo or read the VAT reference page.
curl "https://<your-worker>.workers.dev/v1/validate/vat/DE123456789"
Formats
| Country | Body format |
|---|---|
| AT | AT, U and 8 digits |
| BE | BE, 10 digits starting with 0 or 1 |
| BG | BG, 9 or 10 digits |
| CH | CH, E, 9 digits and an optional MWST, TVA or IVA |
| CY | CY, 8 digits and a letter |
| CZ | CZ, 8, 9 or 10 digits |
| DE | DE, 9 digits |
| DK | DK, 8 digits |
| EE | EE, 9 digits |
| EL | EL, 9 digits |
| ES | ES, 9 characters |
| FI | FI, 8 digits |
| FR | FR, 2 characters and 9 digits |
| GB | GB, 9 or 12 digits, or GD or HA and 3 digits |
| HR | HR, 11 digits |
| HU | HU, 8 digits |
| IE | IE, 8 or 9 characters |
| IT | IT, 11 digits |
| LT | LT, 9 or 12 digits |
| LU | LU, 8 digits |
| LV | LV, 11 digits |
| MT | MT, 8 digits |
| NL | NL, 9 digits, B and 2 digits |
| NO | NO, 9 digits and MVA |
| PL | PL, 10 digits |
| PT | PT, 9 digits |
| RO | RO, 2 to 10 digits |
| SE | SE, 12 digits |
| SI | SI, 8 digits |
| SK | SK, 10 digits |
| XI | XI, 9 or 12 digits, or GD or HA and 3 digits |