By Kurashina Design · MIT License

Japanese phone numbers, checked against the official tables

Validate, format, and find Japanese phone numbers using only the numbering plan and the tables of the Ministry of Internal Affairs and Communications. Node.js, Python, and Java return the same results, offline.

Paste anything

Try kanji digits, labels like TEL:, or a whole message with several numbers.

normalize(…)

national
03-5253-8111
digits
0352538111
international
+81352538111
type
fixed_line

extract(…)

03-5253-8111
Fixed-line blocks
41,987
Number types
5
Languages, same results
3
Data as of
2026-11-01

Why japan-phone

  • Strict, by the MIC documents
    03-1234-5678 is invalid: the MIC tables of local exchange codes have no such block.
  • Reads Japanese as written
    Full-width digits, kanji digits like 〇九〇, labels like TEL:, and notes like (代表) or 内線.
  • Finds numbers in text
    extract picks every phone number out of messages, pages, and business cards, and skips digit strings that are not phone numbers.
  • Never guesses
    normalize rejects 090--1234-5678 and 090-ABCD-5678 instead of repairing them, so forms can ask the user.
  • Traceable sources
    The table is generated from the MIC files, and the URL, date, and SHA-256 of each file ship with every package.
  • Node.js, Python, Java
    One table and one set of tests for all three. No network access and no runtime dependencies.

Examples for real forms, text, and data

Every example runs on this site, and each one comes in Node.js, Python, and Java with the same output.
Forms
Input fields: validate, accept pasted text, check the type, link.
4 examples
Finding numbers in text
Pick phone numbers out of messages, pages, and business cards.
3 examples
Data and storage
Clean, deduplicate, count, and convert stored numbers.
5 examples
Validity rules
Which numbers japan-phone rejects, and why.
2 examples

Compared with libphonenumber

The same formatting for every block, with stricter validity and better reading of Japanese text.
japan-phone libphonenumber
03-1234-5678InvalidValid
090--1234-5678InvalidValid
〇九〇-一二三四-五六七八090-1234-5678Cannot parse

Install

npm install @kurashina-design/japan-phone

import { normalize, extract } from "@kurashina-design/japan-phone";
normalize("〇三(五二五三)八一一一").national; // "03-5253-8111"
extract("日中は090-1234-5678まで").length;      // 1
Kurashina Design

Made by Kurashina Design

japan-phone is designed, built, and maintained by Kurashina Design. The code is under the MIT License. The bundled data was derived from MIC sources.