An eleven digit number given to all Norwegian citizens either when born, upon immigration or when granted political asylum. The personnummer was introduced in 1967 together with the new social security system; Folketrygden. It was meant to help the government keep social security records in an efficient manner with the advent of computers. Together with the system came regulations on what the records could and could not be used for, some fairly strict ones to boot. The regulations are enforced by Datatilsynet, an agency tasked with making sure the privacy of Norwegian citizens are taken care of.
The six first digits denote date of birth in DDMMYY format. If you by chance are born on the same date as me, the first six digits in your personnummer would be 311267.
Next you have three digits to establish your gender. Females have even numbers and males have odd numbers. Numbers run from 100 to 999.
The two last digits are a control number, or if you like, a checksum. Since no two citizens should have the same number and all persons born on the same date should have different numbers, you cannot use the sum of the digits. That would render the checksum unusable in case you swap two numbers in e.g. the birthdate.
Instead, two keys are used. Key #1 is always 3 7 6 1 8 9 4 5 2 and key #2 is always 5 4 3 2 7 6 5 4 3 2 . Now, in order to calculate the first checksum digit, you must multiply the first nine digits in the personnummer with key #1 - one by one. The resulting numbers are added together and should be dividable by 11. If they are not, the gender number is wrong.
The second checksum digit is generated in the same way, only now you need to use the nine first digits plus the first checksum digit. Multiply the 10 digits with the digits in key #2, one by one. Add up all the numbers and check that the result is dividable by 11.
You now have a valid 11-digit Norwegian personnummer. A woman born April 6, 1958 would get the number 06045832837. This is not a real personnummer.
There's a few problems inherent in this system. First of all, if more than 899 persons are born on a single day in the kingdom of Norway, the system will break. Currently 165 new citizens are born each day (statistically speaking), so the system will work for quite a while longer.
Second, the system doesn't provide for changes. If you submit yourself to a hospital for a gender change, your personnummer will not reflect your new status. This has recently been the subject of a fairly low-key debate in Norway. If you are a transsexual, what gender should your personnummer reflect?
If you have no personnummer, you officially do not exist. Wherever you turn for services in the central or local government, the number is what they ask for. It should come as no surprise to the computer people out there that the personnummer is extensively used as an index in all sorts of databases. Hence if they cannot enter your personnummer, they cannot enter you in the database at all.
Finally, immigrants and asylum seekers granted Norwegian citizenship receive their personnummer along with their passport. Actually, it's in the passport. While staying at an asylum seeker camp waiting for your case to be handled, you are not yet a citizen and you lack a very important piece of information. In extreme cases, you could be stuck in the asylum seeker camp for years. The authorities on these things hand out temporary numbers to asylum seekers, but it's still not a real personnummer.
If someone asks you for your personnummer and they're not on the job for a government agency, local government office, social services or the military, deny them the information. Having your number unlocks lots and lots of information in various databases and enables people with the right access to do crosschecks on you. I usually give them the first six digits (my date of birth, commonly called the "birth number") and play dumb for the next three minutes.