How tax identifiers are structured
Most identifiers follow predictable rules: length, allowed character set, and sometimes checksum logic. A format checker can test these rules locally without contacting any authority.
Format-only: Structure checks help catch data-entry errors. They are not proof of validity in a registry.
Structure matrix
Examples of common patterns. Use these for input constraints, UX hints, and data normalization.
| Country | Identifier | Length | Typical structure | Practical note |
|---|---|---|---|---|
| Germany | Steuer-ID | 11 | Digits only | Store as string to preserve leading zeros. |
| France | Numéro fiscal | 13 | Digits only, often starts 0-3 | Displayed on official notices and online accounts. |
| Italy | Codice Fiscale | 16 | Alphanumeric, fixed positional pattern | Often entered with mixed case, normalize to uppercase. |
| Spain | DNI / NIE | 9 | DNI: 8 digits + letter. NIE: X/Y/Z + 7 digits + letter | Letter is position-dependent in many systems. |
| Netherlands | BSN | 9 | Digits only | Often discussed with an 11-test in technical contexts. |
Normalization rules
Before comparing formats, normalize the input consistently.
- Trim leading and trailing whitespace.
- Remove spaces and separators if your UX allows formatted input.
- Uppercase alphanumeric identifiers for consistent comparisons.
- Store identifiers as strings, not integers.
Checksum concepts
Some identifiers embed a checksum to detect typos. The algorithm can often detect a single wrong digit or transposition without consulting a database.
This site does not implement checksum algorithms beyond simple format constraints.
Format constraints in UI
Good forms reduce error rates by making the rule obvious. Examples:
- Show a country-specific placeholder like e.g. 12345678Z.
- Disable input until a country is selected to avoid misleading results.
- Use a single, explicit label such as Valid format structure rather than implying registry validation.