Tool to understand and calculate the digits and information present on French identity cards (the 2 lines of 36 characters at the bottom of the card)
French ID Card - dCode
Tag(s) : Fun/Miscellaneous
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
The French identity ID card contains 72 characters on 2 lines (36 characters each). The first line starts with the letters ID followed by the country code of France: FRA, explanations:
Position | Meaning of content |
---|---|
1-2 | ID |
Always the 2 letters ID (for IDentity) | 3-5 |
FRA | Always the 3 letters FRA, ISO3166 country code on 3 characters |
6-30 | DCODE‹FR‹‹‹‹‹‹br>‹‹‹‹‹‹‹‹‹‹‹‹ |
Lastname on 25-character, formatted in uppercase without accent, with the character ‹ replacing any non-alphabetical character. | 31-33 |
Department number on 3 digits (before 2017 the department was on 2 digits followed by the number of the sub-prefecture) | 34-36 |
ID of the agent having registered the card |
Example: ID FRA DCODE ‹FR ‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹ 001 123
The second line begins with the date of issue of the card followed by additional information including checksum codes, explanations:
Position | Meaning of content |
---|---|
1-2 | Year (on 2 digits) of creation of the card |
3-4 | Month (on 2 digits) of creation of the card |
5-7 | 3-digit department number (same as characters 31-33 of line 1) |
8-12 | Numeric code assigned by the card management system (chronologically incremented code) |
13 | Control key of the preceding 1-12 characters |
14-27 | SITE‹‹‹‹‹‹‹‹‹‹ |
first name on 14-character, formatted in uppercase without accent, with the character ‹replacing any non-alphabetic character and a double chevron ‹‹ for to separate the possible second and third given names. | 28-33 |
Birth date in the format YYMMDD | 34 |
Date of birth control key (characters 28-33) | 35 |
Sex (M or F) | 36 |
Control key of all previous characters (first line of 36 characters + second line of 35 characters) |
Example: 19 06 001 12345 6 SITE ‹‹‹‹‹‹‹‹‹‹ 090101 5 M 1
The checksum is a number (from 0 to 9) it is calculated by associating with each character a value: 0 for the character <, 1,2,3,4,5,6,7,8,9 for numbers and 10 for A, 11 for B, etc. up to 35 for Z.
For each character, multiply it by one factor (among 3), the first will be multiplied by 7, the second by 3, the third by 1, then again the fourth by 7, the fifth by 3, etc.
Sum all the numbers obtained, and record the units digit of the total.
This digit is the control/checksum key.
Example: Calculate the sum and the control key for DCODE1<, the sum is 91+36+24+91+42+1+0=285 and so the key is 5 :
D | 13 | *7 | =91 | Σ=91 |
C | 12 | *3 | =36 | Σ=127 |
O | 24 | *1 | =24 | Σ=151 |
D | 13 | *7 | =91 | Σ=242 |
E | 14 | *3 | =42 | Σ=284 |
1 | 1 | *1 | =1 | Σ=285 |
‹ | 0 | *7 | =0 | Σ=285 |
This dCode generator is limited to the ID number, which is public data. Reminder: using a fake document/identity card is punishable by 5 years' imprisonment and a minimum fine of €75000.
dCode retains ownership of the online 'French ID Card' tool source code. Except explicit open source licence (indicated CC / Creative Commons / free), any 'French ID Card' algorithm, applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any 'French ID Card' function (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and no data download, script, copy-paste, or API access for 'French ID Card' will be for free, same for offline use on PC, tablet, iPhone or Android ! dCode is free and online.
Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!
Thanks to your feedback and relevant comments, dCode has developed the best 'French ID Card' tool, so feel free to write! Thank you!