Valid Dni (ES)
What this tool does
This tool checks if a Spanish identity document number is mathematically valid. It helps you verify that a DNI number follows the official format and checksum rules. This is useful for cleaning up customer lists or confirming the structure of an ID before saving it.
When to use it
- Validating new user registrations in a Spanish context.
- Cleaning up old databases filled with Spanish national IDs.
- Ensuring forms reject obviously incorrect ID numbers.
- Pre-checking data before sending it to other systems.
What to expect
You will receive a simple yes or no answer. The result tells you if the number provided is structurally correct according to the standard validation rule.
Limitations
- This only checks the mathematical formula, not if the person actually exists.
- It does not verify the ID against any government database.
- It only supports the standard numeric DNI format, not NIE numbers.
When it fails
- The input is missing.
- The input is not text.
- The input is empty.
Good to know
- A valid result means the number is well-formed, not that it is currently active.
- The check is case-insensitive for the final letter.
Input data
| Parameter | Required | Example | Description |
|---|---|---|---|
dni | Yes | 44016116 | Enter the DNI number as eight digits followed by one letter (for example, '44016116' or '4401611M'). This field is required. |
Output data
| Field | Description |
|---|---|
result | Indicates whether the DNI number is valid (yes) or invalid (no) based on the format rules. |