The initial letter depends on the place of one's first household registration.
Allowed are all characters of the English alphabet [A-Z].
- A Taipei City(臺北市)
- B Taichung City(臺中市)
- C Keelung City(基隆市)
- D Tainan City(臺南市)
- E Kaohsiung City(高雄市)
- F New Taipei City(新北市)
- G Yilan County(宜蘭縣)
- H Taoyuan City(桃園市)
- I Chiayi City(嘉義市)
- J Hsinchu County(新竹縣)
- K Miaoli County(苗栗縣)
- L Taichung County(臺中縣) no longer issued
- M Nantou County(南投縣)
- N Changhua County(彰化縣)
- O Hsinchu City(新竹市)
- P Yunlin County(雲林縣)
- Q Chiayi County(嘉義縣)
- R Tainan County(臺南縣) no longer issued
- S Kaohsiung County(高雄縣) no longer issued
- T Pingtung County(屏東縣)
- U Hualien County(花蓮縣)
- V Taitung County(臺東縣)
- W Kinmen County(金門縣)
- X Penghu County(澎湖縣)
- Y Yangmingshan Management Bureau(陽明山管理局) no longer issued
- Z Lienchiang County(連江縣)
The second letter is used to encode gender and the nationality status. Many implementations fail to accept non numeric values, discriminating against non Taiwanese nationals.
Taiwanese national with household registration- 1male
- 2female
- Amale
- Bfemale
- Cmale
- Dfemale
The check digit is a weighted sum of the digits, modulo 10, with different weights for each number position.
Letters
The first character (and sometimes the second) are not numeric and the summand of the weighted sum is calculated differently. The letters have a specific value assigned to them.
The easiest way to implement this is to get the index of the letter in the following string and add 10 to it. You will get the assigned number.
Then use following formula for the area code:
In case the gender code is not numeric use following formula:
Numbers
For all numbers calculate the summand of the weighted sum with following formula:
The last step is to compute the check digit:
Compare the calculated check digit and the last number in the ID.