EU VAT number formats by country

Each member state builds its VAT identification number its own way: a prefix of two letters, then eight to twelve characters whose shape and check digit the state publishes (verified for all 28 before VIES is asked). The table below is what the API applies before asking VIES; each row has its own page.

The 28 structures

PrefixCountryStructureExamplePublic check digit
ATAustriaU + 8 digitsATU13585627yes
BEBelgium10 digits (first digit 0 or 1)BE0123456749yes
BGBulgaria9 or 10 digitsBG175074752yes
CYCyprus8 digits + 1 letterCY10259033Pyes
CZCzechia8, 9 or 10 digitsCZ25123891yes
DEGermany9 digitsDE136695976yes
DKDenmark8 digitsDK13585628yes
EEEstonia9 digitsEE100931558yes
ELGreece9 digits (prefix EL, not GR)EL094259216yes
ESSpain9 characters; the first, the last or both are lettersESB58378431yes
FIFinland8 digitsFI09853608yes
FRFrance2 characters (key: digits or letters except O and I) + 9 digits (SIREN)FR40303265045yes
HRCroatia11 digitsHR33392005961yes
HUHungary8 digitsHU21376414yes
IEIreland7 digits + 1 or 2 letters, or 1 digit + 1 letter/+/* + 5 digits + 1 letterIE6388047Vyes
ITItaly11 digitsIT00743110157yes
LTLithuania9 or 12 digitsLT119511515yes
LULuxembourg8 digitsLU15027442yes
LVLatvia11 digitsLV40003521600yes
MTMalta8 digitsMT11679112yes
NLNetherlands9 digits + B + 2 digitsNL004495445B01yes
PLPoland10 digitsPL8567346215yes
PTPortugal9 digitsPT501964843yes
RORomania2 to 10 digitsRO18547290yes
SESweden12 digits, ending in 01SE556188840401yes
SISlovenia8 digitsSI50223054yes
SKSlovakia10 digitsSK2022749619yes
XINorthern Ireland9 or 12 digits, or GD/HA + 3 digitsXI110305878yes

Questions

Does a well-formed number mean a valid one?
No. The structure says the string can be a VAT number of that state; only VIES says it is registered. A structural pass saves the VIES call when the input cannot be a number at all.

Sources