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

vehicle-identification-number-validator

v1.0.1

Published

Zero-dependency ISO 3779 & US 49 CFR Part 565 Vehicle Identification Number (VIN) check digit validator and model year decoder.

Readme

ISO 3779 & US 49 CFR Part 565 VIN Validator Engine

License: MIT TypeScript Standards

Zero-dependency TypeScript library for validating 17-character Vehicle Identification Numbers (VINs), verifying mathematical Position 9 Modulo-11 check digits, and decoding 30-year cyclic model years under ISO 3779 and US 49 CFR Part 565.

Live interactive implementation: UseCOS VIN Decoder & Recall Hub.


Overview

Under ISO 3779, ISO 3780, and the United States National Highway Traffic Safety Administration (NHTSA 49 CFR Part 565), every road vehicle manufactured since 1981 carries a unique 17-character Vehicle Identification Number.

In North America, position 9 is reserved as a mandatory mathematical check digit calculated via a weighted modulo 11 algorithm. This check detects over 95% of transcription errors, accidental typos, and fraudulent VIN tampering.


VIN Structure Anatomy

A 17-character VIN is broken into three distinct international sections:

| Characters | Section | Name | Description | | :--- | :--- | :--- | :--- | | 1 – 3 | WMI | World Manufacturer Identifier | Geographic region, country of manufacture, and vehicle manufacturer. | | 4 – 8 | VDS | Vehicle Descriptor Section | Model line, body style, engine type, transmission, and restraint systems. | | 9 | Check | Check Digit | Mathematical verification digit (0–9 or X). | | 10 | VIS | Model Year | 30-year cyclic alphanumeric encoding representing the vehicle year. | | 11 | VIS | Assembly Plant | Manufacturer-specific assembly plant identification code. | | 12 – 17 | VIS | Sequential Production Number | Unique vehicle serial number on the production line. |

Prohibited Characters: Under ISO 3779 § 4.1, the letters I, O, and Q are strictly forbidden to prevent visual confusion with the digits 1 and 0.


Check Digit Algorithm & Mathematical Formulation

1. Transliteration Values

Each alphanumeric character is mapped to a designated integer value:

| Character | Value | Character | Value | Character | Value | | :--- | :--- | :--- | :--- | :--- | :--- | | 0 – 9 | $0 - 9$ | E | $5$ | P | $7$ | | A, J | $1$ | F | $6$ | R | $9$ | | B, K, S | $2$ | G | $7$ | T | $3$ | | C, L, T | $3$ | H | $8$ | U | $4$ | | D, M | $4$ | N | $5$ | V | $5$ | | W | $6$ | X | $7$ | Y | $8$ | | Z | $9$ | | | | |

2. Positional Weight Vector

Each position in the 17-character string is assigned a statutory weight:

$$\vec{w} = [8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2]$$

(Notice weight $0$ at index 8 corresponds to position 9, the check digit itself).

3. Modulo 11 Calculation

$$\text{Sum} = \sum_{i=1}^{17} \vec{w}_i \cdot v(c_i)$$

$$\text{Check Digit} = \text{Sum} \pmod{11}$$

If $\text{Remainder} = 10$, the check character is represented by Roman numeral X.


Model Year Cyclic Decoding (Position 10)

Model years rotate through a 30-year cycle using 21 uppercase letters (omitting I, O, Q, U, Z) followed by digits 1–9:

  • Cycle 1 (1980–2000): A (1980) $\dots$ Y (2000)
  • Cycle 2 (2001–2009): 1 (2001) $\dots$ 9 (2009)
  • Cycle 3 (2010–2030): A (2010) $\dots$ Y (2030)

Installation & Usage

npm install iso-3779-vin-validator

TypeScript Example:

import { validateVin, decodeModelYear } from 'iso-3779-vin-validator';

// 1. Validate a complete 17-character VIN
const result = validateVin('1HGCM82633A004352');

if (result.valid) {
  console.log('WMI:', result.wmi);                       // "1HG" (Honda USA)
  console.log('Check Digit:', result.checkDigit);       // "3"
  console.log('Model Year:', result.modelYear);         // 2003
  console.log('Serial Number:', result.sequentialNumber); // "004352"
} else {
  console.error('Validation failed:', result.error);
}

// 2. Decode model year directly
console.log(decodeModelYear('P')); // 2023
console.log(decodeModelYear('T')); // 2026

Edge Cases: North America vs European Market (EU)

While all modern vehicles sold in the United States, Canada, and Mexico mandate the mathematical check digit at position 9 under federal regulation, European domestic vehicles (which do not export to North America) sometimes treat position 9 as an arbitrary manufacturer-assigned descriptor code.

This engine flags non-matching check digits while clearly identifying whether the syntax adheres to ISO 3779 structure.


Live Implementation & Tools


License

MIT © UseCOS Engineering. Open-source for developers, automotive engineers, and consumer protection platforms.