node package manager


Finland Identity Number Library

Finnish Identity Number Library

This library is a collection of functions dealing with Finnish specific identification numbers.

  • hetu -- Finnish HETU numbers
  • ytunnus -- Finnish corporate IDs
  • refnum -- Invoice reference numbers (viitenumero)
  • pankkiviivakoodi -- Virtual bank transfer numbers (virtuaaliviivakoodi)

Simplest way to install is to use npm, just simply npm install fin-id.

MIT-style license, see INSTALL.txt.

Each feature is a property:

var hetu = require('fin-id').hetu;

See examples/ for full examples.

The call hetu.check(hetu) returns true if the argument is valid ID:

if(hetu.check('010171-1234')) console.log("valid");
else console.log("invalid");

The call hetu.parse(hetu) returns an object with additional information:

var parsed = hetu.parse('010171-1234');
if(parsed) {
    console.log("birthday is " +;  // Fri, 01 Jan 1971 
    console.log("sex is " +;        // 'female' 
var refnum = require('fin-id').refnum;

To create reference number use .create(num)

=> '12344'

To check reference number use .check(num)

=> true

To strip the number back to original use .strip(refnum)

=> '1234'

To parse the reference number .parse(refnum)

refnum.parse('00001 2344');
=> '1234'
var viivakoodi = require('fin-id').pankkiviivakoodi;

To create number use .create(...)

    iban: 'FI21 1234 5600 0007 85',
    cents: 1000,
    duedate: '2015-03-01',
    refnum: 13
=> '421123456000007850000100000000000000000000000013150301'

To check numbers use .check(num)

=> true

You can buy commercial support from Sendanor.