PESEL ( Polish Powszechny Elektroniczny System Ewidencji Ludności, Universal Electronic System for Registration of the Population) is the national identification number used in Poland since 1979. It always has 11 digits, identifies just one person and cannot be changed to another one (except some specific situations).
The PESEL number is mandatory for all permanent residents of Poland and for temporary residents living in Poland for over 2 months. After the 1st March 2015, applicants for Polish passport without a PESEL number will need to apply for PESEL prior to passport application. Otherwise, without a PESEL number, passport application and fingerprints cannot be taken.
The PESEL was the system designed by the communist government (during PRL) to trace a personal information about every citizen. It is a direct offshoot from the previous system, MAGISTER (an acronym spelling out the word 'Master', like a Masters degree), which was designed to trace and record data about everyone with a university degree.
PESEL number has the form of YYMMDDZZZXQ, where YYMMDD is the date of birth (with century encoded in month field), ZZZX is the personal identification number, where X codes sex (even number for females, odd number for males) and Q is a check digit, which is used to verify whether a given PESEL is correct or not.
Having a PESEL in the form of ABCDEF GHIJK, one can check the validity of the number by computing the following expression:
A*1 + B*3 + C*7 + D*9 + E*1 + F*3 + G*7 + H*9 + I*1 + J*3
Then the last digit of the result should be subtracted from 10. If the result of the last operation is not equal to the last digit of a given PESEL, the PESEL is incorrect. This system works reliably well for catching one-digit mistakes and digit swaps.
Checking validity of PESEL: 44051401358 (number 8, the last digit, is the check digit for this PESEL):
1 * 4 + 3 * 4 + 7 * 0 + 9 * 5 + 1 * 1 + 3 * 4 + 7 * 0 + 9 * 1 + 1 * 3 + 3 * 5 = 101
Getting the last digit of the result (101 modulo 10):
101/10 = 10 remainder 1
In order to get the check digit one need to take the 10s complement of the number. It is 0 if the modulo result is 0, otherwise it means the modulo result has to be subtracted from 10.
10 - 1 = 9
9 is not equal to the last digit of PESEL, which is 8, so the PESEL contains errors.