Crowdsourcing Validation Rules for Uganda National ID

I am curious about the ability to validate that the Uganda National Identification Number (NIN) is well formed. However this does not validate that the NIN actually belongs to the person presenting it or that it is correct.

The rules that I have been able to gleam are:

  1. Must be 14 characters long
  2. First character is a letter of the alphabet. C seems to be a common letter – does it stand for citizen?
  3. Second letter is either M or F – male or female
  4. Characters 3 and 4 are numbers, which are the year of birth. Cannot be after 00 since that would make a person below 18
  5. Characters 5, 6, 7 are numbers

How can you help? Which of these rules do not match your NIN? Share any additional patters to build a repository of rules that can later be mapped to programming language validations – Regular expressions and validation frameworks


4 responses to this post.

  1. 1. TRUE
    2. FALSE: P
    3. TRUE
    4: TRUE
    5. TRUE
    6. Last 2 are letters



  2. Yep, being able to parse and validate the NIN would be a great idea. Thanks for sharing.



  3. Posted by mcnemesis on March 6, 2018 at 07:58

    Great Idea. Thanks for sharing. Also, more interestingly, I wonder if at a later date, we’ll be able to easily query an “externally” available NIN database, where for example cross referencing with MSISDNs is possible. That’d open up some new validation frameworks and KYC possibilities currently difficult to pull off.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: