---
id: "idcard"
kind: "datatype"
status: "stable"
is_pii: true
categories: ["pii", "persons"]
country: ["CN"]
langs: ["zh"]
quality: 75
url: "http://registry.apicrafter.io/datatype/idcard"
---

# Chinese ID card (身份证) by known name (`idcard`)

Citizen identification number of the People's Republic of China, printed on the Resident Identity Card (居民身份证). Since 1999 it has 18 characters, a six-digit address code, the date of birth as YYYYMMDD, a three-digit sequence code and a check digit computed with ISO 7064 MOD 11-2, where X stands for 10. Older numbers have 15 digits, with a two-digit year and no check digit.

- Personal data (PII): yes
- Categories: Personally identifiable information (pii), Person related (persons)
- Countries: China (CN)
- Languages: Chinese (zh)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^(?:\d{17}[\dX]|\d{15})$
```

## Mappings

- autotype: `cin`
- dpv: `pd:OfficialID`
- purview: `China resident identity card (PRC) number`
- stdnum: `cn.ric`

## Metacrafter rules

3 rules: 3 match the field name, 0 match values.

- `cnidcardknown` (field, `cn/cn_persons.yaml`)
- `cn_pii_cnidcardknown` (field, `pii/cn/cn_pii.yaml`)
- `zhidcardknown` (field, `pii/zh/zh_pii.yaml`)

## Supported by tools

- `autotype`
- `awsglue`
- `azureailanguage`
- `databricks`
- `dataprep`
- `metacrafter`
- `microsoftpurview`
- `pythonstdnum`

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/Resident_Identity_Card>

## Quality

Score 75/100. Missing: examples, negative example, translation.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/idcard.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/CN/persons/idcard.yaml>
