Japanese government code
The six-digit local government code identifying a Japanese prefecture or municipality, being the standard area code with a check digit.
The all-Japan local government code was introduced in 1968 and is used wherever a code needs to be verifiable on entry. The specification defines it as the five-digit area code with one check digit added.
The check digit is computed by weighting the five digits by 6, 5, 4, 3 and 2, summing the products, and deriving the last digit from the remainder modulo 11. Aichi 23000 gives 230006, Abashiri 01211 gives 012114, Abeno ward in Osaka 27119 gives 271195.
Because the first five digits are the Japanese area code, the two fields never disagree, and a value whose check digit does not compute is a transcription error rather than an unknown municipality.
Numbers from 801 to 999 in the municipal part are not municipalities. They are partial-affairs associations, joint bodies formed by several municipalities, and do not belong on a place.
