Get Personal $1.00 / 1,000 calls

NIF by DNI (ES)

What this tool does

This tool converts a Spanish personal identity card number (DNI) into the corresponding tax identification number (NIF) for individuals. It helps users ensure they have the correct official identifier for administrative or billing records. The system performs a local mathematical check to generate the final alphanumeric code based on the provided digits.

When to use it

  • Verifying a customer's tax ID when setting up a new account.
  • Correcting an incomplete or incorrect ID number in a form.
  • Ensuring data consistency between Spanish identity records and tax databases.
  • Automating the capture of valid tax identifiers from Spanish customer data.

What to expect

You will receive the full, validated tax identification number as a text string. If the input is invalid, the system will return an empty value.

Limitations

  • This tool only supports Spanish DNI numbers. It does not work with foreign IDs or Spanish tax IDs for companies (CIF).
  • The input must be exactly eight digits. If the number is shorter or longer, the tool will not return a result.
  • Non-numeric characters in the input will cause the conversion to fail.

When it fails

  • The entered ID number is not exactly eight digits long.
  • The input contains letters, symbols, or is left blank.
  • The input is not a sequence of pure numbers.

Good to know

  • Always double-check the eight digits before submitting, as the tool cannot correct typos.
  • The result is a fixed calculation; it does not verify if the person exists or if the ID is active, only that the format is valid.

Input data

Parameter Required Example Description
dni Yes 44016116 Enter the 8-digit Spanish identity card number (for example, '44016116'). This field is required. If the number is missing, has fewer than 8 digits, or contains letters, the tool will not return a result.

Output data

Field Description
result Returns the full NIF as a text string combining the DNI and the calculated letter (for example, '44016116T'). Returns empty text if the input DNI is invalid or incomplete.