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

@daichodo/validate

v0.2.0

Published

Validate Japanese corporate numbers (法人番号) and qualified invoice registration numbers (登録番号). Zero dependencies, no network.

Readme

@daichodo/validate

法人番号と適格請求書発行事業者の登録番号を検証します。依存関係なし、通信なし、APIキー不要。

Validate Japanese corporate numbers (法人番号) and qualified invoice registration numbers (登録番号). Zero dependencies, no network, no API key.

npm install @daichodo/validate
import { validateRegistrationNumber } from '@daichodo/validate';

validateRegistrationNumber('T1010001153225');
// { value: 'T1010001153225', valid: true, corporateNumber: '1010001153225' }

日本語

検査用数字の計算式は国税庁が公表している仕様に基づくため、サービスへの接続は不要です。

判定できるのは形式として正しいかであり、実際に登録されているかではありません。 登録の有無や有効期間を確認するには daichodo.com の API を ご利用ください。

チェックディジットは個人事業主にも適用されます

チェックディジットは個人事業主の登録番号にも適用されます。 2026年9月5日に 実測して修正しました。全件データ(2026年8月31日)と直近の差分、あわせて 5,421,496件を検証した結果、法人・個人事業主・人格のない社団等のすべてが チェックディジットを満たしました。例外はゼロ件です。

validateRegistrationNumber('T1234567890123');
// { valid: false, reason: 'check digit is 1, expected 9' }

個人事業主の13桁は法人番号ではありません(抽出した5万件のうち、法人番号登録簿に 存在したものはゼロ件)。しかし採番規則は同じで、チェックディジットは同様に成立します。 つまり番号だけでは法人か個人事業主かを判別できません。判別できるのは登録簿の 照会のみです。

以前のバージョンはチェックディジットが合わない番号を「個人事業主だから」として 有効扱いにしていました。実在する番号はすべてチェックディジットを満たすため、この 扱いは打ち間違いや架空の番号をすべて通してしまうものでした。

English

The check-digit rules come from the National Tax Agency's published specification, so this needs no service behind it.

It tells you whether a number is well-formed — not whether it is registered. For registration status and validity dates you need the API at daichodo.com.

Sole traders are not exempt from the check digit

Corrected 2026-09-05, by measurement. Every registration number in the register satisfies the check digit — corporations, sole traders and 人格のない社団等 alike. Counted over the 全件 of 2026-08-31 and the newest 差分: 5,421,496 numbers, zero exceptions.

validateRegistrationNumber('T1234567890123');
// { valid: false, reason: 'check digit is 1, expected 9' }

A sole trader's 13 digits are not a 法人番号 — none of 50,000 sampled appear in the corporate register — but they come from the same numbering scheme, so the check digit holds. The number alone cannot tell you whether it belongs to a corporation or a sole trader. Only a register lookup can.

Earlier versions returned valid: true when the check digit failed, excusing it as a sole trader. Since every genuine number passes, that accepted every typo and every fabrication instead.

ライセンス / Licence

MIT.


出典:国税庁法人番号公表サイト(国税庁)(https://www.houjin-bangou.nta.go.jp/)を加工して作成