Sythong Run


A Quest to Learn About Cambodia's 21-Digit BAC II ID Numbers

Sythong Run

TL:DR: I was intrigued by Cambodia's test candidate ID system, so I investigated and learned that the 21-digit numeric string contains the following information: the student's school code, the type of school they attend, their grade level, their academic route, and their unique student ID.

How my quest began

Last August, my younger sister sent me a photo of her Baccalauréat de la deuxième Partie (BAC II) test candidate identification (ID) card. The BAC II is the second diploma test a high school student in Cambodia must take if they wish to graduate. The first test is completed in grade 9 and the second in grade 12. The test lasts two days and would mark a student's last days in high school. Sending her card to me was her way of telling me she felt ready and anxious about the coming days. Many students also took to platforms such as TikTok and Facebook to share their nervous excitement. What struck me was how long her test candidate ID was: a 21-digit numeric string with no spaces or dashes between the digits.

A test-taker ID photo showing the province of the test center, the student's candidate number, full name, sex, date of birth, and province of birth, the father's name, the mother's name, and the school director's name and signature, with a red government stamp at the bottom of the card.
With my sister's permission, I've censored confidential information from her BAC II test ID and recreated what appears on it in the photo.

With a quick probability calculation (1021), I learned that the 21-digit string would allow for a sextillion combinations of numbers; that's a 1 followed by 21 zeros! I had to look up what a number with 21 zeros is called. That's far more unique identifiers than needed for everyone on Earth, let alone Cambodia. To put this in perspective, with the estimated number of stars in our galaxy being between 100 billion and 400 billion, a sextillion is 2.5 to 10 billion times larger than this estimate. Using the BAC II system, even if we assigned IDs to every person on Earth and every star we've identified, we still wouldn't run out. So, I wondered, what's behind the numbers of a BAC II ID?

I called up a friend, Adrian, and together we worked on this newfound puzzle.

The investigation

We started the investigation by collecting sample BAC IDs from Facebook and TikTok. Although those students chose to post their full IDs online, it was not my prerogative to do anything else than review those IDs to look for patterns. As such, I will not share the data here in order to protect their privacy. Students IDs from both 9th and 12th grade students were collected and recorded. Information initially thought to offer some clues includes their BAC ID numbers, birth province, testing province, gender, and grade level. This information could help test different theories about what each digit might represent.

For reasons I might explain in a future post, even though I attended high school in Cambodia, I did not have to take the BAC. Instead, I had to fulfill specific academic requirements to earn my diploma. I had very little knowledge of the national exam, so before diving deeper, I first needed to understand how the BAC system actually works. I texted my sister with questions and searched for articles online. I wanted to identify specific hypotheses to test. For example, does the code indicate which foreign language a student chooses? Does it show whether they're on a science or social science track? My sister seemed puzzled by my sudden interest in the BAC system, but I kept my investigation secret for the moment.

For a quick background, 9th and 12th grader are tested on various subjects. While 9th grader don’t need to pick their concentration, 12th graders must pick between two paths: social science (focused on theoretical knowledge) or science (focused on logic and reasoning). Both routes test students on seven subjects.

Science route students are tested on:

  1. Biology
  2. Chemistry
  3. Foreign language
  4. Khmer literature
  5. Physics
  6. Mathematics
  7. One subject chosen by the Ministry of Education, Youth and Sport (MoEYS) each year, either Geography, History, Moral and Civic Education, or Earth and Environmental Sciences. For the 2025 exam, History was selected.

Social science route students are tested on:

  1. History
  2. Geography
  3. Foreign language
  4. Mathematics
  5. Moral and Civic Education
  6. Khmer literature
  7. One subject chosen by MoEYS each year, either Physics, Chemistry, Biology, or Earth and Environmental Sciences. For the 2025 exam, Earth and Environmental Sciences was selected.

Adrian and I combed through news articles, explored school databases on Open Development Cambodia and reviewed documents from the MoEYS. We also found provincial coding data from the Ministry of Economy and Finance.

What I learned

After the research, it seems that we have cracked the code. The graphic below summarizes what we believe each part of the BAC ID represents.

Diagram breaking down what the different digits on the BAC II ID card means.

Let’s dive into the code. The first 11 digits refer to the school's location:

Notice that the code gets longer as the information becomes more specific. For example, it only takes two digits to identify a province, two more to specify a district within that province, and so on. While verifying that the first 11 digits was in fact the school ID, I noticed something interesting about the province codes and the names of the provinces, this will be discussed further in the next section.

The 12th digit, represented by the letter "L," refers to the schooling type. For this code, I am confident that the number 1 refers to a public school and 9 refers to a private school. This was verified by cross-referencing school codes in files provided by MoEYS with the school stamps on testers' IDs. All public schools use the same government stamp, whereas private schools have their own unique stamps. The assignments of numbers 2 and 3, however, are conclusions based on limited observations. Firstly, instead of a high school name being listed on the student’s card, the city of residence was listed, leading me to believe that these test takers were not enrolled at a high school. Secondly, their high school code (on the their ID card) appeared as 1 followed by ten 0’s. Based on news articles about older BAC II candidates and reading birthdates on the IDs I found online, it appears that 2 refers to non-enrolled test-takers under the age of 50 (the data I have are of test-taker in their mid-20s), while 3 refers to non-enrolled test-takers over 50.

The 13th and 14th digits, represented by letters "M" and "N," indicate the student's grade level—09 is used for the 9th grade diploma and 12 is used for the 12th grade BAC II.

The 15th digit, represented by letter "O," tells us about the student's academic path. The assignment of 0 means the student has no concentration, which applies only to 9th graders who are not required to select a route. The assignment of 1 means a student picked the science path, and 2 means social science. This was confirmed by asking my sister about her path and cross-checking with the recent trend of more students picking the social science path. This is also reflected in my data, where most IDs were assigned the number 2 in the 15th digit.

Finally, the last six digits, digits 16 through 21, are the student's unique identifiers.

In summary, from our analysis, we learned that the BAC II candidate code contains the following information: the student's school location, the type of school they attend, their grade level, their academic route, and their unique student ID. Now let’s talk about another quest I started through this investigation—and I hope some of you can help me.

The Other Quest that Arose From This

Through examining school codes, I noticed that the two-digit province codes generally align with the alphabetical order of the English spellings of the province names. Using the Gazetteer of Cambodia 2023 report, I discovered that every province follows this pattern except for the last four: Oddar Meanchey, Kep, Pailin, and Tbong Khmum (see image below).

At first, I thought the break in alphabetical order was related to when each province was created. Tbong Khmum, for example, was the most recently created province, established in 2014 when it split from Kampong Cham. So it made sense that Tbong Khmum would break the alphabetical order and take the next available code, 25.

However, looking at Oddar Meanchey, Kep, and Pailin puzzled me. Oddar Meanchey was created in 1964 and re-established in 1995. Kep and Pailin cities were both re-classified as provinces in 2008. From a 2018 presentation by Cambodian officials I found, it appears that the Geography Department of Cambodia was established in 1991, years after Oddar Meanchey became a province—so why doesn't it follow the alphabetical pattern? Why does a province that starts with "O" come after ones that start with "S?"

Moreover, Kep has been assigned code 23 since November 17, 2000, before it was reclassified as a province—why did it not follow the alphabetical pattern then? You might think it didn't follow the pattern because it wasn't a province at the time. However, Sihanoukville was also a city that was reclassified as a province in 2008, but it followed the alphabetical pattern in 2000—so why the inconsistency? If anyone has thoughts on this, please let me know.