DNI Validator

Enter a Spanish DNI to check whether its control letter is correct.

How to use

  1. Enter your values in the fields above.
  2. Press Calculate to see your result instantly.
  3. Use the Share button to copy a link to your result.

About this calculator

Spain's national identity number, the DNI (Documento Nacional de Identidad), pairs an 8-digit number with a single control (check) letter that guards against typos and forged documents. The letter is derived deterministically: take the 8-digit number, compute its remainder on division by 23, and use that remainder (0–22) as an index into the fixed 23-character string "TRWAGMYFPDXBNJZSQVHLCKE" — the letter at that position is the correct one.

Because the algorithm is public and purely arithmetic, anyone can verify — but not forge new valid numbers from — a DNI's check letter without needing access to any government database, which is why banks, telecom providers and online services performing basic format validation in Spain check this letter locally before accepting an ID number; the same modulo-23 scheme, with a prefix conversion, also validates the foreigner-resident NIE number.

Was this helpful?

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators