Identify the type of number
A DNI has eight digits and a letter. An NIE begins with X, Y or Z. A Spanish entity NIF begins with a letter and ends with a check character.
Practical guide
This Spanish tax ID checker tests whether the format and check character are consistent. Use it to catch typing errors before saving invoice details. It can check a DNI, NIE or entity NIF locally in the browser. Confirm who the number belongs to separately with the official tax authority when needed.
Check the Spanish tax ID formatThe Aipiter teamPublished Reviewed
If the check character fails, ask for the number again. If it matches and you need to confirm the holder or their tax status, use the relevant official service.
The calculator runs in your browser and does not keep the identifier you enter.
Your browser checks the identifier without sending or storing it. To confirm who it belongs to, check the Spanish Tax Agency’s register. IDs starting with K, L or M and EU VAT numbers are outside the scope.
A DNI has eight digits and a letter. An NIE begins with X, Y or Z. A Spanish entity NIF begins with a letter and ends with a check character.
Enter a single Spanish identifier. The calculation runs in the browser and reports an unsupported format or a failed check.
See how to check a tax ID on the Spanish tax agency’s register if you are entitled to use the service. Check VIES separately for intra-EU VAT registration.
Worked example
These are illustrative test inputs rather than customer records.
| Item | Example value |
|---|---|
| 00000000T | Passes the checksum |
| 00000000A | Fails the checksum |
| Ownership | Requires a separate check |
If it fails, check the original document before updating the customer’s record.
Spaces and hyphens are accepted when pasting a number. Check the remaining characters against the document.
Use VIES to verify intra-EU status.
Confirm a correction with the customer before saving it.
Create my accountWith your permission, we use third-party cookies to measure site use and to measure enquiries from ads and show you Aipiter ads based on your visit. You can reject them and still use the site. Cookie policy