id validator

Validate an identification number

Options

Using with form field

* presents a required option. The HTML attributes are used to set the validator options via the Declarative plugin

Name HTML attribute Type Description
country* data-fv-id___country String or Function An ISO-3166 country code
message data-fv-id___message String The error message

The validator supports the following countries (click the sample number to validate it):

# Country Abbreviation ID system Country code Sample ID Is it valid?
1 Argentinia DNI AR 2012345699
2 Bosnia and Herzegovina JMBG BA 0101006100008
3 Brazil CPF BR 231.002.999-00
4 Bulgari EGN BG 7542011030
5 Chile RUN/RUT CL 10601212-6
6 China RIC CN 999999199304070016
7 Colombia NIT CO 213.123.432-1
8 Croatia OIB HR 33392005961
9 Czech RC CZ 991231123
10 Denmark CPR DK 2110625629
11 Estonia isikukood EE 37605030291
12 Finland HETU FI 131052-308U
13 France NIR FR 253072C07300443
14 Hong Kong HKID HK G5661828
15 Iceland Kennitala IS 0902862549
16 India Aadhaar ID 234123412347
17 Ireland PPS IE 6433435VH
18 Israel Mispar Zehut IL 001200343
19 Korea RRN KR 701112-2606161
20 Latvia Personas kods LV 161175-19997
21 Lithuania Asmens kodas LT 38703181745
22 Macedonia ЕМБГ MK 0101006430038
23 Malaysia NRIC MY 770305021234
24 Mexico CURP MX HEGG560427MVZRRL04
25 Montenegro JMBG ME 0101006230045
26 Netherlands BSN NL 9413.31.490
27 Norway Fødselsnummer NO 68413152113
28 Peru CUI PE 434518267
29 Poland PESEL PL 04271113861
30 Romania CNP RO 1800101221144
31 San Marino - SM 23567
32 Serbia JMBG RS 0101006750045
33 Slovakia RC SK 991231123
34 Slovenia EMŠO SI 010100650000
35 South Africa South African ID ZA 8001015009287
36 Spain DNI/NIE/CIF ES X-2482300-W
37 Sweden personnummer SE 811228+9874
38 Switzerland AHV-Nr/No AVS CH 7561234567895
39 Taiwan - TW U267859590
40 Thailand - TH 7145620509547
41 Uruguay - UY 12345672

Using with ES6 module

Basic Example

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

ES6 Module Example

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

More examples

Related validators

The following validators might be useful to you.