npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

german-insurance-number-validator

v1.0.6

Published

Angular 19–22 library to validate German health insurance numbers (Krankenversichertennummer / Versichertennummer / KVNR). Checksum logic tested on 100,000+ numbers. Includes a standalone input component and reactive-forms validator.

Readme

german-insurance-number-validator

Validates German health insurance numbersKrankenversichertennummer / Versichertennummer (KVNR): 1 letter + 9 digits with an official-style checksum.

The checksum logic has been tested against more than 100,000 German insurance numbers.

Requires Angular 19, 20, 21, or 22.

Terminology

| English | German | Abbreviation | | --- | --- | --- | | German health insurance number | Krankenversichertennummer, Versichertennummer | KVNR |

Features

  • Standalone input component with label and built-in English error messages
  • Reactive Forms validator (germanInsuranceNumberValidator())
  • Pure helper isValidGermanInsuranceNumber() for use outside templates
  • Empty values are treated as valid (pair with Validators.required when the field is mandatory)
  • Works with formControl / formControlName via ControlValueAccessor

Validation rules

| Rule | Detail | | --- | --- | | Length | Exactly 10 characters | | Format | First character is a letter (AZ, case-insensitive); the rest are digits | | Checksum | Letter mapped to two digits (A = 01Z = 26), then alternate multiply by 1 and 2, cross-total, compare sum % 10 to the last digit |

Example of a valid number: A123456780.

Installation

npm install german-insurance-number-validator

Peer dependencies: @angular/core, @angular/common, and @angular/forms (Angular 19–22).

Standalone input component

import { Component } from '@angular/core';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { GermanInsuranceNumberInputComponent } from 'german-insurance-number-validator';

@Component({
  selector: 'app-profile-form',
  imports: [ReactiveFormsModule, GermanInsuranceNumberInputComponent],
  template: `
    <german-insurance-number-input
      [formControl]="insuranceNumber"
      label="German insurance number"
      [required]="true"
    />
  `,
})
export class ProfileFormComponent {
  insuranceNumber = new FormControl('');
}

Input options

| Input | Type | Default | Purpose | | --- | --- | --- | --- | | label | string | German insurance number | Visible field label | | placeholder | string | e.g. A123456789 | Input placeholder | | required | boolean | false | Marks the field required and shows the required message | | requiredMessage | string | German insurance number is required. | Override required error text | | invalidMessage | string | Please enter a valid German insurance number. | Override checksum/format error text | | inputId | string | auto-generated | Links the label to the input | | showErrorsWhen | 'touched' \| 'dirty' \| 'submitted' | 'touched' | When to show validation messages |

Validator only

Use this when you already have your own input UI:

import { FormControl, Validators } from '@angular/forms';
import {
  germanInsuranceNumberValidator,
  VALIDATION_ERROR_KEY,
} from 'german-insurance-number-validator';

const control = new FormControl('', [
  Validators.required,
  germanInsuranceNumberValidator(),
]);

if (control.errors?.[VALIDATION_ERROR_KEY]) {
  // invalid insurance number
}

Invalid values set:

{ "validationError": "Please enter a valid German insurance number." }

Pure utility

import { isValidGermanInsuranceNumber } from 'german-insurance-number-validator';

isValidGermanInsuranceNumber('A123456780'); // true
isValidGermanInsuranceNumber('A123456789'); // false
isValidGermanInsuranceNumber('');           // true (optional field)

Reliability

The checksum algorithm used by this package has been tested over 100,000+ German insurance numbers.

License

MIT

Source: github.com/ITRIX/german-insurance-number-validator