Tool to understand and calculate the digits and information present on French identity cards (the lines of 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 card contains an optical reading strip written in black on a white background at the bottom of the card. It contains all card information in a structured format.
The French identity card (European version 2021) contains 90 characters on 3 lines (of 30 characters each). The first line begins with the letters ID followed by the country code of France: FRA, explanations:
Position | Meaning of content |
---|---|
1-2 | Always the 2 letters ID (for IDentity) |
3-5 | Always the 3 letters FRA, ISO3166 country code on 3 characters |
6-14 | Official document number (Card number composed of 9 alphanumeric characters) |
15 | Checksum for Card number |
16-30 | Empty/Not used (filled with <) |
Example: ID FRA 123456789 X ‹‹‹‹‹‹‹‹‹‹‹‹‹‹‹
The second line begins with the date of birth followed by the sex and the expiry date, explanations:
Position | Meaning of content |
---|---|
1-2 | Year (on 2 digits) of birth |
3-4 | Month (on 2 digits) of birth |
5-6 | Day (on 2 digits) of birth |
7 | Birthdate checksum |
8 | Sex (M or F) |
9-10 | Year (on 2 digits) of expiry of the card |
11-12 | Month (on 2 digits) of expiry of the card |
13-14 | Day (on 2 digits) of expiry of the card |
15 | Expiry date checksum |
16-18 | Always the 3 letters FRA, for the nationality of the holder |
19-29 | Empty/Not used (filled with <) |
30 | Checksum for document number control key concatenated with date of birth and date of expiry |
Example: 990130 X M 490101 X FRA ‹‹‹‹‹‹‹‹‹‹ X
The third line contains the name of the cardholder:
Position | Meaning of content |
---|---|
1-30 | Family name and first name(s) formatted in uppercase without accent with the character ‹ replacing any non-alphabetic character with a double chevron ‹‹ to mark the end of the name and therefore the beginning of the first name. |
Example: DUPONT‹‹MICHEL‹JEAN‹‹‹‹‹‹‹‹‹‹‹
The French identity ID card (1995 version) 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
In the 2021 version, the identity card number consists of characters 6 to 14 of the first line (the number consists of 9 alphanumeric characters)
Example: DOCUMENT NUMBER XXXXXXXXXX
In the 1995 version, the number consists of the first 12 digits of the second line.
Example: CARTE NATIONALE D'IDENTITÉ NºXXXXXXXXXXXX
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 last (unit) digit of the total number.
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 |
The dCode generator is limited to public data, the numbers and internal codes provided by the administration are private. Reminder: using a fake document/identity card/paper is punishable by 5 years' imprisonment and a minimum fine of €75000.
dCode retains ownership of the "French ID Card" source code. Except explicit open source licence (indicated Creative Commons / free), the "French ID Card" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "French ID Card" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "French ID Card" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.
The copy-paste of the page "French ID Card" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
French ID Card on dCode.fr [online website], retrieved on 2024-12-21,