ID number check digit calculator
Is the number well formed — the check digit worked out.
Output
Paste or type above to see the result here.
Your files stay on your device
This tool runs entirely in your browser. What you paste is processed on your device and is never sent to a server, so it is safe to use with tokens, keys and unpublished text.
Example
A Spanish NIE on a rental form: catching a wrong letter before it is sent
A couple moving from the UK to Spain fill in a rental application. Her NIE is X1234567L; his is written X1234567T on the form; and the agency wants the letter for a number noted down without one. Choose “Spain — NIE (foreigners)” and paste the numbers, one a line.
- The first letter of an NIE stands for a digit: X is 0, Y is 1, Z is 2. So X1234567 is read as 01234567.
- That number is divided by 23: 1234567 ÷ 23 = 53676 remainder 19. Place 19 in the row TRWAGMYFPDXBNJZSQVHLCKE, counting from 0, is L.
- X1234567L is marked ✓ valid. X1234567T is marked ✗, with L as the letter that number needs — so one of the two was copied wrongly.
- Y7654321, typed without a letter, gets one worked out: 17654321 ÷ 23 leaves 4, so the letter is G.
| Typed | Number chosen | The checker says |
|---|---|---|
| X1234567L | Spain — NIE | ✓ valid (remainder 19 → L) |
| X1234567T | Spain — NIE | ✗ not valid — the letter should be L |
| Y7654321 | Spain — NIE | → Y7654321G, letter worked out (remainder 4) |
| 12345678 | Spain — DNI | → 12345678Z, letter worked out (remainder 14) |
| 123 456 789 | Portugal — NIF | ✓ valid: weighted sum 156, 156 ÷ 11 leaves 2, 11 − 2 = 9 |
The T was a slip of the pen: the NIE on his papers ends in L. A correct letter only shows that the number is well formed — not that the NIE was issued, or to whom.
How it works
- Choose the kind of number.
- Paste one number a line; dots, dashes and spaces are fine.
- Each is checked, with the formula for its check digit filled in step by step.
Frequently asked questions
- What is a check digit?
- A digit (or letter) computed from the others, so that a mistyped number is caught: change one digit and the check no longer fits.
- Can it generate valid numbers?
- No. It checks numbers you type. For a Spanish DNI without its letter, or a French RIB without its key, it computes the missing check for that number, as the official calculators do.
- Does a valid check digit mean the number exists?
- No — only that it is correctly written. Whether it was issued, and to whom, only the issuing authority can say. The checker never makes up numbers either: it checks the ones you type.
- How is the letter of a Spanish NIE worked out?
- Replace the first letter by a digit (X = 0, Y = 1, Z = 2), divide the number by 23 and look the remainder up in TRWAGMYFPDXBNJZSQVHLCKE: 0 is T, 1 is R, 2 is W … 22 is E. A DNI works the same way without the first step: 12345678 leaves 14, which is Z.
- Can I check several numbers at once?
- Yes — up to 20, one a line. Dots, dashes and spaces are ignored, so 111.444.777-35 and 11144477735 are the same CPF. Each line gets its own ✓ or ✗ with the working under it.
- Is anything uploaded?
- No. The check is worked out in your browser, and nothing you type leaves your computer.
Made for a specific use
Related tools
⌂ IBAN validator Is the IBAN right — and why. ▭ Codice fiscale calculator The Italian tax code, part by part. ¥ PDF tools Invoice generator A PDF invoice from a short form, previewed as you type. 歳 Age calculator Years, months and days, the next birthday and the zodiac year, for as many dates as you paste.