id validator

Validate a Swedish identification number

Basic Example

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

Sample ID Is it valid?
8112289874
811228-9874
811228+9874
811228-9873

Module Example

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


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

const res1 = seId().validate('811228+9874');
// res1.valid === true

const res2 = seId().validate('811228-9873');
// 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