personnummer

validate swedish personal identity numbers

personnummer is a small open-source project that validates, formatting and determine sex and age from swedish personal identity numbers. support the project by becoming a backer or sponsor via OpenCollective.

available in:Bash,C#,D,Dart,Elixir,Go,Java,JavaScript,Kotlin,Lua,Perl,PHP,Python,Ruby,Rust,Scalaand forSwift

features

  • validation
  • formatting
  • determine age
  • determine sex
  • determine if coordination number

all features might not be implemented in all languages, you can read the full specification here.

try

input

result

validno
short formatn/a
long formatn/a
agen/a
sexn/a
coordination numberno

using javascript version 3.1.0

generate personal identity numbers

result

some implementations may be in work in progress if you find a bug, please open an issue in the specific implementation repository.

if an implementation in your favorite language is missing, feel free to port it over from one of the existing versions. there's still plenty of languages to contribute in: R, Nu, Groovy, Julia, Racket, F#, Clojure

license

all personnummer packages are under MIT license.

Copyright © 2020 Personnummer and Contributors - GitHub - Twitter