id validator

Validate a Chinese identification number

Basic Example

You can click on sample from the following table to see if it's a valid or invalid Chinese id.

Sample ID Is it valid?
450202201409072332
22011219930407001X
110108601017023
999999199304070016

Module Example

The following snippet shows how to use the id validator with JavaScript module:


// You might need to change the importing path
import cnId from 'formvalidation/validators/id/cnId';

const res1 = cnId().validate('22011219930407001X');
// res1.valid === true

const res2 = cnId().validate('999999199304070016');
// res2.valid === false

Related validators

The following validators are similar to this one and might be useful to you.

Name Description
id Validate an identification number
vat Validate VAT number