MRZ and Driver’s license Generator/Calculator

How and were to generate a passport Machine Readable Passport MRZ code:
MRZ Generator  Calculator – www.highprogrammer.com/cgi-bin/uniqueid/mrzp

https://emvlab.org/mrz/

 

How and were to generate a Driver’s License number from your information:
Driving license Generator Calculator – www.highprogrammer.com/cgi-bin/uniqueid

 

How and were to generate a Driver’s License Barcode PDF417 from your information:
Driving license Barcode pdf 417 Generator Calculator – https://pdf417.pro/states/

 

Driver’s license number:

A number of states encode your name, gender, and date of birth in your license number.

Soundex is a hashing system for english words. You might want to look at further information on how soundex works.

The example soundex is F255, so the example name starts with F, so the name starts with an F, followed by a gutteral or sibilant, followed by a nasal, followed by another nasal. This is correct, as the example person’s last name is “Fakename”

For my license generator, I simply implement this. For my license reverser, I simply take likely guesses. I also generated the Soundex code for the top 10,000 (ish) last names in the US, and I suggest the top 10 for any given code.

Look up your first name on this table:

Name Code Name Code Name Code
Albert 20 Frank 260 Marvin 580
Alice 20 George 300 Mary 580
Ann 40 Grace 300 Melvin 600
Anna 40 Harold 340 Mildred 600
Anne 40 Harriet 340 Patricia 680
Annie 40 Harry 360 Paul 680
Arthur 40 Hazel 360 Richard 740
Bernard 80 Helen 380 Robert 760
Bette 80 Henry 380 Ruby 740
Bettie 80 James 440 Ruth 760
Betty 80 Jane 440 Thelma 820
Carl 120 Jayne 440 Thomas 820
Catherine 120 Jean 460 Walter 900
Charles 140 Joan 480 Wanda 900
Dorthy 180 John 460 William 920
Edward 220 Joseph 480 Wilma 920
Elizabeth 220 Margaret 560
Florence 260 Martin 560
Donald 180
Clara 140

If you fail to find your name, look up your first initial on this table:

Initial Code Initial Code Initial Code Initial Code
A 0 H 320 O 640 V 860
B 60 I 400 P 660 W 880
C 100 J 420 Q 700 X 940
D 160 K 500 R 720 Y 960
E 200 L 520 S 780 Z 980
F 240 M 540 T 800
G 280 N 620 U 840

Now look up your middle initial on this table:

Initial Code Initial Code Initial Code Initial Code
A 1 H 8 O 14 V 18
B 2 I 9 P 15 W 19
C 3 J 10 Q 15 X 19
D 4 K 11 R 16 Y 19
E 5 L 12 S 17 Z 19
F 6 M 13 T 18
G 7 N 14 U 18

Now, if add together the code for either your first name (if possible) or your first initial to the code for your middle inital.

So, the example FFF code is 921. Looking it up, it’s William or Wilma A. If it had been 001, we would simply know at the their initials are A. A. Since the example was generated for “William Andrew Fakename” this is correct.

This portion encodes the month and day you were born on. The general equation is:

General: (birth_month – 1) * month_multiplier + birth_day + gender_mod

Florida: (birth_month – 1) * 40 + birth_day + (male:0, female: 500)

Illinois: (birth_month – 1) * 31 + birth_day + (male:0, female: 600)

Wisconsin: (birth_month – 1) * 40 + birth_day + (male:0, female: 500)

birth_month is the number of months into the year, January is 1, December is 12.

month_multiplier varies by state. Illinois uses 31. Wisconsin and Florida both use 40.

gender_mod varies by state. In Illinois men use 0, women use 600. In Wisconsin and Florida men use 0, women use 500.

If the result is less than 100, add zeroes to the left side to make it 3 digits. (So, January 1st is encoded as “001” for men in Illinois.)

 

Now about the passport. What is the MRZ code?

The International Civil Aviation Organization, a Quebec based group, developed standards for Machine Readable Travel Documents (MRTDs), including passports and visas. These MRTD make it easy for automated systems to scan a travel document. If a country decides to check all visitors against a known criminals data reading the information automatically with a computer will be much faster and less prone to error than if the immagration agent needs to type the information in by hand.

On a MR Passport there are two lines. Each line is 44 characters long. There are no blank spaces; where one is necessary is it filled with the filler character, a less than sign (<).

All fields are padded with less than signs (<) to fill the required width. There should be no whitespace in the MRZ. Only letters A through Z, digits 0 through 9, and the filler character < are allowed. Some extended letters are mapped to other sets of characters per the following table. The alternate encoding is used when the normal encoding might caused confusion between different names.

The first letter is “P”, designating a passport.

The second character can be assigned by the issuing country to distinguish different types of passports. If unused a < is assigned.

The United States, at least in the cases I’ve seen, doesn’t use this field.

In the example above there is a <, apparently the fictional country of Utopia doesn’t specify specific types, or Anna doesn’t need one.

The issuing country or organization, encoded in three characters. The code is pulled from this table.

Country Code
Afghanistan AFG
Albania ALB
Algeria DZA
American Samoa ASM
Andorra AND
Angola AGO
Anguilla AIA
Antarctica ATA
Antigua and Barbuda ATG
Argentina ARG
Armenia ARM
Aruba ABW
Australia AUS
Austria AUT
Azerbaijan AZE
Bahamas BHS
Bahrain BHR
Bangladesh BGD
Barbados BRB
Belarus BLR
Belgium BEL
Belize BLZ
Benin BEN
Bermuda BMU
Bhutan BTN
Bolivia BOL
Bosnia and Herzegovina BIH
Botswana BWA
Bouvet Island BVT
Brazil BRA
British Indian Ocean Territory IOT
Brunei Darussalam BRN
Bulgaria BGR
Burkina Faso BFA
Burundi BDI
Cambodia KHM
Cameroon CMR
Canada CAN
Cape Verde CPV
Cayman Islands CYM
Central African Republic CAF
Chad TCD
Chile CHL
China CHN
Christmas Island CXR
Cocos (Keeling) Islands CCK
Colombia COL
Comoros COM
Congo COG
Cook Islands COK
Costa Rica CRI
Côte d’Ivoire CIV
Croatia HRV
Cuba CUB
Cyprus CYP
Czech Republic CZE
Democratic People’s Republic of Korea PRK
Democratic Republic of the Congo COD
Denmark DNK
Djibouti DJI
Dominica DMA
Dominican Republic DOM
East Timor TMP
Ecuador ECU
Egypt EGY
El Salvador SLV
Equatorial Guinea GNQ
Eritrea ERI
Estonia EST
Ethiopia ETH
Falkland Islands (Malvinas) FLK
Faeroe Islands FRO
Fiji FJI
Finland FIN
France FRA
France, Metropolitan FXX
French Guiana GUF
French Polynesia PYF
Gabon GAB
Gambia GMB
Georgia GEO
Germany D
Ghana GHA
Gibraltar GIB
Greece GRC
Greenland GRL
Grenada GRD
Guadeloupe GLP
Guam GUM
Guatemala GTM
Guinea GIN
Guinea-Bissau GNB
Guyana GUY
Haiti HTI
Heard and McDonald Islands HMD
Holy See (Vatican City State) VAT
Honduras HND
Hong Kong HKG
Hungary HUN
Iceland ISL
India IND
Indonesia IDN
Iran, Islamic Republic of IRN
Iraq IRQ
Ireland IRL
Israel ISR
Italy ITA
Jamaica JAM
Japan JPN
Jordan JOR
Kazakhstan KAZ
Kenya KEN
Kiribati KIR
Kuwait KWT
Kyrgyzstan KGZ
Lao People’s Democratic Republic LAO
Latvia LVA
Lebanon LBN
Lesotho LSO
Liberia LBR
Libyan Arab Jamahiriya LBY
Liechtenstein LIE
Lithuania LTU
Luxembourg LUX
Madagascar MDG
Malawi MWI
Malaysia MYS
Maldives MDV
Mali MLI
Malta MLT
Marshall Islands MHL
Martinique MTQ
Mauritania MRT
Mauritius MUS
Mayotte MYT
Mexico MEX
Micronesia, Federated States of FSM
Monaco MCO
Mongolia MNG
Montserrat MSR
Morocco MAR
Mozambique MOZ
Myanmar MMR
Namibia NAM
Nauru NRU
Nepal NPL
Netherlands, Kingdom of the NLD
Netherlands Antilles ANT
Neutral Zone NTZ
New Caledonia NCL
New Zealand NZL
Nicaragua NIC
Niger NER
Nigeria NGA
Niue NIU
Norfolk Island NFK
Northern Mariana Islands MNP
Norway NOR
Oman OMN
Pakistan PAK
Palau PLW
Panama PAN
Papua New Guinea PNG
Paraguay PRY
Peru PER
Philippines PHL
Pitcairn PCN
Poland POL
Portugal PRT
Puerto Rico PRI
Qatar QAT
Republic of Korea KOR
Republic of Moldova MDA
Réunion REU
Romania ROM
Russian Federation RUS
Rwanda RWA
Saint Helena SHN
Saint Kitts and Nevis KNA
Saint Lucia LCA
Saint Pierre and Miquelon SPM
Saint Vincent and the Grenadines VCT
Samoa WSM
San Marino SMR
Sao Tome and Principe STP
Saudi Arabia SAU
Senegal SEN
Seychelles SYC
Sierra Leone SLE
Singapore SGP
Slovakia SVK
Slovenia SVN
Solomon Islands SLB
Somalia SOM
South Africa ZAF
South Georgia and the South Sandwich Island SGS
Spain ESP
Sri Lanka LKA
Sudan SDN
Suriname SUR
Svalbard and Jan Mayen Islands SJM
Swaziland SWZ
Sweden SWE
Switzerland CHE
Syrian Arab Republic SYR
Taiwan Province of China TWN
Tajikistan TJK
Thailand THA
The former Yugoslav Republic of Macedonia MKD
Togo TGO
Tokelau TKL
Tonga TON
Trinidad and Tobago TTO
Tunisia TUN
Turkey TUR
Turkmenistan TKM
Turks and Caicos Islands TCA
Tuvalu TUV
Uganda UGA
Ukraine UKR
United Arab Emirates ARE
United Kingdom of Great Britain and Northern Ireland
    – Citizen GBR
    – Dependent territories citizen GBD
    – National (overseas) GBN
    – Overseas citizen GBO
    – Protected Person GBP
    – Subject GBS
United Republic of Tanzania TZA
United States of America USA
United States of America Minor Outlying Islands UMI
Uruguay URY
Uzbekistan UZB
Vanuatu VUT
Venezuela VEN
Viet Nam VNM
Virgin Islands (Great Britian) VGB
Virgin Islands (United States) VIR
Wallis and Futuna Islands WLF
Western Sahara ESH
Yemen YEM
Zaire ZAR
Zambia ZMB
Zimbabwe ZWE
United Nations Organization
(If indicating nationality,
indicates an UN offical)
UNO
United Nations
specialized agency official
UNA
Stateless (per Article 1 of 1954 convention) XXA
Refugee
(per Article 1 of 1951 convention,
amended by 1967 protocol)
XXB
Refugee (non-convention) XXC
Unspecified / Unknown XXX

The passport number, as assigned by the issuing country. Each country is free to assign numbers using any system it likes. If the number has non-letter or number characters they are replaced with the filler character <.

The general format is “LAST<NAME<<FIRST<NAME<ADDITIONAL<NAMES<<<<<“. The name is entirely upper case. Puncuation (like hyphens) are replaced with the filler character < The surname is given first, then the filler character twice (<<), then the remainder of given names. Separate names in the surname or given name are separated with the filler character < The filler character < pads out the field to fill 39 characters.

Suffixes (Jr, Sr, II, III, etc) are encoded as part of the last name, without punctuation.

If the name is too long to fit the most significant parts of the name are used. Names may abbreviated if necessary to make them fit.

In the above example Anna’s surname is Eriksson, her first and middle names are Anna and Maria. Her name is encoded as

ERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<

George Michael Richards-Stevens Jr. would be encoded as

RICHARDS<STEVENS<JR<<GEORGE<MICHAEL<<<<

Check digits are calculated based on the previous field. Thus, the first check digit is based on the passport number, the next is based on the date of birth, the next on the expiration date, and the next on the personal number. The check digit is calculated using this algorithm.
First, break the input into individual characteres and numbers.

Next, convert non-digits into numbers. A through Z are encoded to 10 through 25. The filler character < is encoded as 0.

< A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
Now, multiply each number by the corresponding weighting. The first digit is multipled by 7, the next by 3, and the next by 1. The pattern then repeats (7, 3, 1, 7, 3, 1, 7, 3, 1, etc).

Add up the results, then divide by 10. The remainder is the check digit.

As a special case, if the personal number on the second line is not used (and thus entirely filled with the filler character <), the check digit for that section can be replaced with the filler character <.

An example for the input AB2134:

Input: A B 2 1 3 4 < < <
Value: 10 11 2 1 3 4 0 0 0
Weight: 7 3 1 7 3 1 7 3 1
Products: 70 33 2 7 9 4 0 0 0
Sum: 70 + 33 + 2 + 7 + 9 + 4 + 0 + 0 + 0 = 125
Division: 125 ÷ 10 = 12, remainder 5

Check Digit Calculations
First, break the input into individual characteres and numbers.

Next, convert non-digits into numbers. A through Z are encoded to 10 through 25. The filler character < is encoded as 0.

< A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
Now, multiply each number by the corresponding weighting. The first digit is multipled by 7, the next by 3, and the next by 1. The pattern then repeats (7, 3, 1, 7, 3, 1, 7, 3, 1, etc).

Add up the results, then divide by 10. The remainder is the check digit.

As a special case, if the personal number on the second line is not used (and thus entirely filled with the filler character <), the check digit for that section can be replaced with the filler character <.

An example for the input AB2134:

Input: A B 2 1 3 4 < < <
Value: 10 11 2 1 3 4 0 0 0
Weight: 7 3 1 7 3 1 7 3 1
Products: 70 33 2 7 9 4 0 0 0
Sum: 70 + 33 + 2 + 7 + 9 + 4 + 0 + 0 + 0 = 125
Division: 125 ÷ 10 = 12, remainder 5

Check Digit Calculations
First, break the input into individual characteres and numbers.

Next, convert non-digits into numbers. A through Z are encoded to 10 through 25. The filler character < is encoded as 0.

< A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
Now, multiply each number by the corresponding weighting. The first digit is multipled by 7, the next by 3, and the next by 1. The pattern then repeats (7, 3, 1, 7, 3, 1, 7, 3, 1, etc).

Add up the results, then divide by 10. The remainder is the check digit.

As a special case, if the personal number on the second line is not used (and thus entirely filled with the filler character <), the check digit for that section can be replaced with the filler character <.

An example for the input AB2134:

Input: A B 2 1 3 4 < < <
Value: 10 11 2 1 3 4 0 0 0
Weight: 7 3 1 7 3 1 7 3 1
Products: 70 33 2 7 9 4 0 0 0
Sum: 70 + 33 + 2 + 7 + 9 + 4 + 0 + 0 + 0 = 125
Division: 125 ÷ 10 = 12, remainder 5

Check Digit Calculations
First, break the input into individual characteres and numbers.

Next, convert non-digits into numbers. A through Z are encoded to 10 through 25. The filler character < is encoded as 0.

< A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
Now, multiply each number by the corresponding weighting. The first digit is multipled by 7, the next by 3, and the next by 1. The pattern then repeats (7, 3, 1, 7, 3, 1, 7, 3, 1, etc).

Add up the results, then divide by 10. The remainder is the check digit.

As a special case, if the personal number on the second line is not used (and thus entirely filled with the filler character <), the check digit for that section can be replaced with the filler character <.

An example for the input AB2134:

Input: A B 2 1 3 4 < < <
Value: 10 11 2 1 3 4 0 0 0
Weight: 7 3 1 7 3 1 7 3 1
Products: 70 33 2 7 9 4 0 0 0
Sum: 70 + 33 + 2 + 7 + 9 + 4 + 0 + 0 + 0 = 125
Division: 125 ÷ 10 = 12, remainder 5

Generate your MRZ code number or your Driver’s License number here: