Personnummer is a small open-source project created to validate, format and determine sex and age from swedish personal identity numbers. Support the project by becoming a backer or sponsor at OpenCollective.
available in:Bash,C/C++,C#,Clojure,D,Dart,Elixir,Gleam,Go,Haskell,Java,JavaScript,Kotlin,Lua,Perl,PHP,Python,Ruby,Rust,Scala,Swiftand forV.
All features might not be implemented in all languages. Full specification can be found here.
input
result
valid | no |
short format | n/a |
long format | n/a |
age | 0 |
sex | n/a |
coordination number | no |
interim number | no |
using javascript version 3.2.1
result
qr code
Some implementations may be a work in progress if you find a bug, please open an issue in the specific implementation repository.
If an implementation for your favorite language is missing, feel free to port it over from one of the existing versions. There are still plenty of languages to contribute to: R, Nu, Groovy, Julia, Racket, F#, Clojure, Erlang.
All personnummer packages are released under the MIT license.