How this works
The Cartão de Cidadão document number has 12 characters: eight digits of the civil ID number, the check digit of that number, two version positions (letters or digits) and, at the end, the document's own check digit. Validation is a Luhn (mod 10): right to left, double every second character; if a doubled value reaches 10 or more, subtract 9; add everything up, with letters converted (A=10 through Z=35). If the total ends in zero, the number is well-formed.
- 1
Clean and convert
Spaces and dashes are stripped, everything is uppercased, and each letter is swapped for its value (A=10, B=11, …, Z=35). Digits stay as they are.
- 2
Double every second one
Right to left, double every second character (not the last, yes the second-from-last, and so on).
- 3
Reduce the ones over 9
Whenever a doubling reaches 10 or more, subtract 9. For example, a doubled Z is 35×2=70, which becomes 61.
- 4
Add up and divide by 10
Add all the values. If the remainder of dividing by 10 is zero, the document number is structurally valid.
Frequently asked
What is the difference between the document number and the civil ID number?
The civil ID number is the first eight digits plus its check digit (e.g. 12345678 9). It is your lifelong "BI number" and does not change when you renew the card. The document number is those nine characters plus the version (two letters) and a final check digit — and it changes with each new card. This validator checks the full 12-character document number.
Where do I find the document number on the card?
It is on the front of the Cartão de Cidadão, in the lower-right corner next to the photo, usually printed with a space before the check digit and before the letters (e.g. 00000000 0 ZZ4). To validate, ignore the spaces.
Does a formula-valid number mean the card is genuine?
No. The formula only confirms the 12 characters are mathematically well-formed — it catches typos, not forgeries. A number can pass the calculation and still never have been issued, or belong to a cancelled card. To confirm a card is genuinely valid, use official channels.
Does this tool send my number anywhere?
No. The calculation runs entirely in your browser. There is no server, no database, no lookup against any public body. You can even go offline after the page loads.
Which letters can appear in the card version?
The two version positions accept letters A to Z and digits 0 to 9. In the calculation, letters count as A=10, B=11, and so on up to Z=35; digits count as themselves. This is the same conversion table the AMA publishes.
DISCLAIMER
This tool only checks the document number's mathematics. It does not confirm whether the card exists, is active, was cancelled or who it belongs to, and it queries no official body. It is no substitute for a check with the State's services (gov.pt, the IRN/registries or the tax authority), and it is not legal advice.