Every person registered with the Italian tax authority, the Agenzia delle Entrate, has a codice fiscale: 16 letters and digits printed on the tessera sanitaria (the health insurance card) and asked for by employers, landlords, banks and public offices. Foreign citizens get one too when they deal with Italian taxes or administration, and the code is built from their personal details in exactly the same way.
Characters 1 to 6. Three letters from the surname and three from the first name, mostly consonants. They are a fingerprint of the name, not the name itself: RSS fits Rossi, Russo and Rossetti alike.
Characters 7 and 8. The last two digits of the year of birth. The century is not written anywhere, so the decoder picks the most recent year that is not in the future: 99 becomes 1999, 05 becomes 2005.
Character 9. The month, as a letter: A January, B February, C March, D April, E May, H June, L July, M August, P September, R October, S November, T December.
Characters 10 and 11. The day of birth, which also gives the sex. Men keep the day as it is, from 01 to 31. Women have 40 added, so their day runs from 41 to 71: a woman born on the 15th shows 55.
Characters 12 to 15. The place of birth. For people born in Italy it is the cadastral code of the comune, one letter and three digits (H501 is Rome, F205 is Milan). For people born abroad it is the code of their country, always a Z followed by three digits: Z404 for the United States, Z114 for the United Kingdom, Z602 for Brazil. A comune that was later merged or renamed keeps its old code in the tax codes of the people born there.
Character 16. The check letter, computed from the first 15 characters with two conversion tables (one for odd positions, one for even ones) and the remainder of a division by 26. It catches typing mistakes. It does not catch invented codes: anyone who knows the rule can build a code with a correct last letter.
Omocodia. When two people would end up with the same code, the Agenzia delle Entrate changes one of them by replacing one or more of its seven digits with letters (L for 0, M for 1, N for 2, P for 3, Q for 4, R for 5, S for 6, T for 7, U for 8, V for 9), starting from the right, and computes a new check letter. The decoder turns those letters back into digits and reads the code as if nothing had been replaced.