A test tax ID is a business identifier with the correct format and check digit for its country that is not registered to any business. This generator produces US Employer Identification Numbers and six checksum-valid formats — UK VAT, German USt-IdNr., French TVA, Spanish CIF, Canadian Business Numbers and Australian ABNs — each attached to a fictional company, for testing invoicing, onboarding, KYB and tax-calculation code.
How to use it
- Pick a jurisdiction.
- Toggle separators to test both the printed form (
GB 566 7862 84,58 566 786 262) and the compact form your database stores. - Attach a company name and registration date if your form or fixture needs them.
- Export the batch as JSON, CSV or SQL. The same seed regenerates the same IDs.
What you can control
- United States — EIN: nine digits with a real IRS-assigned prefix (
20,26,27,45–47,81–88), formattedXX-XXXXXXX. - United Kingdom — VAT: nine digits whose weighted mod-97 check passes, prefixed
GB. - Germany — USt-IdNr.:
DEplus nine digits, the last computed with ISO 7064 MOD 11,10. - France — TVA:
FR, a two-digit key, and a Luhn-valid nine-digit SIREN. - Spain — CIF: organisation letter, seven digits and a control digit or letter, depending on the entity type.
- Canada — Business Number: a Luhn-valid nine-digit BN with an
RT0001program account. - Australia — ABN: eleven digits satisfying the ABR's weighted mod-89 rule.
How the check digits differ
Each country solved the same problem — catching typos before a lookup — in a different way:
| Format | Algorithm |
|---|---|
| UK VAT | First seven digits × weights 8, 7, 6, 5, 4, 3, 2; the last two digits bring the sum to a multiple of 97 |
| German USt-IdNr. | ISO 7064 MOD 11,10: a running product over the first eight digits |
| French TVA | Key = (12 + 3 × (SIREN mod 97)) mod 97, and the SIREN itself is Luhn-valid |
| Spanish CIF | Luhn-like sum over seven digits; the control is a digit, a letter from JABCDEFGHI, or either, depending on the entity letter |
| Canadian BN | Luhn over the nine-digit root |
| Australian ABN | Subtract 1 from the first digit, weight by 10, 1, 3, 5 … 19, and require a sum divisible by 89 |
To check them in a test, python-stdnum covers all six: stdnum.gb.vat, stdnum.de.vat, stdnum.fr.tva, stdnum.es.cif, stdnum.ca.bn and stdnum.au.abn, each with an is_valid() function.
Testing ideas
- Country prefix handling. Users type VAT numbers with and without the
GBorDEprefix, and with spaces. Generate both forms and check your field accepts and normalises them. - Reverse-charge logic. EU B2B invoices change tax treatment when the buyer has a valid VAT number in another member state. Use a French and a German number to exercise both branches.
- Lookup failure. Your code should treat "valid format, not registered" differently from "invalid format". These IDs give you the first case on demand.
- Display and masking. Check invoice PDFs and emails render the separators correctly.
What this is not
A correct check digit is not a registration. None of these numbers belongs to a company, and a VIES, HMRC or ABR lookup will say so. Use them in test environments only, and see Check digits that test data must satisfy for more on why the digit matters.