What an EU VAT identification number is
A VAT identification number (VATIN) identifies a taxable person for value-added tax in EU and related schemes. On invoices and B2B portals it usually appears with a country prefix (ISO-like letters) followed by a national identifier whose length and checksum rules differ by member state. Format correctness is a first filter before calling online registries.
Create structurally plausible numbers for fixtures with generate. Check pasted values against country rules with validate.
Format versus registry status
Structural validation answers: “Does this string match the length, character set, and checksum rules we implement for country X?”
It does not answer: “Is this number active, assigned to the named company, or cleared for intra-EU zero-rated supplies?” Those questions require official services such as the European Commission VIES system (and national portals), plus commercial due diligence.
Suspended, merged, or fraudulently obtained numbers can still look syntactically perfect.
Family of tools
- Generate European VAT number — pick a country scheme and mint a checksum-aware test VATIN for ERP demos, signup forms, and invoice pipelines.
- Validate European VAT number — select the country, paste the number, and receive pass/fail against prefix, length, and checksum handlers.
Typical workflow in software teams: generate fixtures → store in staging → validate user input offline → optionally call VIES in production with caching and rate limits.
Country-specific patterns (conceptual)
Implementations encode per-country handlers. Patterns you will see across Europe:
- Fixed total length after the prefix
- Numeric-only versus alphanumeric national parts
- Checksum algorithms (Luhn, modulo-11 variants, weighted digit sums, and country-specific tables)
- Optional spacing or separators in human display that must be stripped before checks
Italian and Spanish numbers, for example, often exercise Luhn-style checks in educational validators; other states use different moduli. Always normalize case and strip spaces before comparing.
Why generate checksum-valid fakes
Forms that only regex for “two letters + digits” accept many invalid strings and reject some valid edge cases. Checksum-valid generators let QA prove that:
- Client and server validators agree
- Invoice PDF renderers preserve the full identifier
- Import jobs do not truncate leading zeros inside the national part
Keep generated numbers in test tenants. Do not present them as credentials for real tax filings.
Validation checklist for applications
- Reject empty input.
- Uppercase letters; remove spaces and punctuation.
- Read or require an explicit country (do not guess from ambiguous prefixes alone when your product already knows the jurisdiction).
- Enforce length and character class for that country.
- Run the national checksum when defined.
- Return stable reasons (
invalid-length,invalid-checksum,unsupported-country) for UI mapping. - For compliance-critical paths, call an official registry asynchronously and store the consultation evidence your auditors expect.
Display and storage
Display. Users may type spaces (IT 12345678901 style). Tolerate them in the input layer.
Storage. Persist the compact electronic form your tax engine expects—usually uppercase alphanumeric without spaces, with a consistent policy on whether the country prefix is stored separately.
Logging. VAT numbers identify businesses; mask or hash them in analytics unless retention is justified.
Limits of static rule packs
National formats evolve. A static browser rule set can lag regulatory updates. Treat validation as a defense-in-depth layer, not the sole compliance control. When rules change, regenerate fixtures and update contract tests.
Financial disclaimer
VAT tools here are for education, development, and format checking. They are not tax, legal, or financial advice and do not replace VIES or national authority verification. Do not use generated numbers for real invoicing, customs, or refund claims. Confirm counterparties and VAT status through official channels before zero-rating, filing, or releasing payment.
Common mistakes
- Validating with the wrong country handler after a copy-paste from another market
- Storing the number with a
VATlabel prefix that breaks checksum math - Assuming
OKfrom format checks means the trader is trustworthy - Shipping demo VATINs into production customer records
Summary
EU VAT numbers combine a country prefix with a national identifier governed by local length and checksum rules. This hub’s generate and validate tools help you build and test those structural rules offline. Pair them with official registry checks and qualified tax advice whenever the result affects real invoices or compliance decisions.