Unique Master Citizen Number


Unique Master Citizen Number is a unique identification number that was assigned to every citizen of former Yugoslav republics of the SFR Yugoslavia. Today it continues to be used in almost all of the countries that were created after the dissolution of YugoslaviaBosnia and Herzegovina, Montenegro, North Macedonia, Serbia and Slovenia use it in its original form, while Croatia has switched to a new identification number called the Personal Identification Number.

History

The JMBG was introduced on January 8, 1977 and applied to all citizens born before then and alive at the time. All six republics passed a law on the Unique Master Citizen Number.
Although the Republic of Croatia continued to use the JMBG after the independence in 2002 the official name of the number there was changed to Matični broj građana, acronym MBG. Advocates of the right to privacy argued that JMBG was a piece of personally identifiable information that needed to be protected by information privacy law, mostly because it was unique and it included the person's date of birth. When the law to that effect was passed in 2003 it was no longer possible to use JMBG on identity cards, driver's licenses and similar documents. Even though law hid MBG from personal documents, various institutions continued to demand citizens to give their MBG while signing various contracts, since MBG was natural unique identifier of each citizen. Seeing flaw of hiding MBG, on January 1, 2009 Croatia passed a new law that introduced a different unique identifier called the Personal Identification Number. The OIB consists of 11 randomly chosen digits and has been assigned to all Croatian citizens, companies registered in Croatia and foreign nationals residing in Croatia. Although the OIB is in use, the MBG law remains in effect, and the MBG number is still issued. It is used for data coordination among government registries. MBG no longer appears on Croatian identity cards since 2003, instead OIB does, since 2013.

Composition

The number is made up of 13 digits in a form "DD MM YYY RR BBB K" where:

Checksum calculation

The checksum is calculated from the mapping = , using the formula:
Note: there has been a small number of JMBGs that were assigned by valid authorities but which had an invalid checksum. Also, there are a few duplicate JMBGs in existence. The common anecdotal explanation for these is simple operator error. Reportedly these mistakes happened more often in the early 1990s. The chances of running into exceptions are reportedly low, and whether such exceptions justify questioning the use of JMBG as a unique identifier has not been scientifically analyzed.

Microsoft Excel formula

B1 = 11-+MID))++MID))++MID))++MID))++MID))++MID)))),11))
C1 =CONCATENATE
12

Ruby code for validation


def validjmbg jmbg

len = jmbg.scan.size
valid_chars =

if len != 13 or !valid_chars
return false
else
j = jmbg.split.map
v = 11-+
6*+
5*+
4*+
3*+
2*)%11)
v = 0 if v > 9
return v j
end
end

Example

As an example, a valid identification number is 0101006500006; it is the number of the first male baby registered in Slovenia on January 1, 2006.