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/C++,C#,D,Dart,Elixir,Go,Java,JavaScript,Kotlin,Lua,Perl,PHP,Python,Ruby,Rust,Scalaand forSwift
all features might not be implemented in all languages, you can read the full specification here.
input
result
valid | no |
short format | n/a |
long format | n/a |
age | n/a |
sex | n/a |
coordination number | no |
using javascript version 3.1.3
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
all personnummer packages are under MIT license.