Compared with libphonenumber

Where japan-phone and Google's libphonenumber agree, where they differ, and how to use both.

Google's libphonenumber is a widely used library for numbers of many countries. For Japanese numbers, the two libraries format the same way. They differ in which numbers they accept and in how they read Japanese text.

We compared libphonenumber 9.0.45 for Java and libphonenumber-js 1.13.18 in December 2026, parsing with region JP and checking with isValidNumber.

Formatting is the same

For all 41,987 fixed-line blocks in the MIC tables, libphonenumber placed the hyphens exactly as japan-phone does. Mobile, 050, 0120, 0800, and 0570 numbers matched too.

Validity differs

libphonenumber accepted 27,113 fixed-line blocks that are not in the MIC tables. In 11,749 of them, the digit after the area code is 0 or 1; the MIC tables have no such block. japan-phone rejects them all.

Inputjapan-phonelibphonenumber
03-1234-5678InvalidValid
092-123-4567InvalidValid
090--1234-5678InvalidValid
090-ABCD-5678InvalidJava converts it to 090-2223-5678; JavaScript cannot parse it

The MIC tables have had no blocks added in the six years we checked (from December 2020), so we expect rejecting blocks outside them to rarely reject a real number.

Japanese text differs

Inputjapan-phonelibphonenumber
〇九〇-一二三四-五六七八090-1234-5678Cannot parse
電話番号:03-5253-8111(内線21‐214)03-5253-8111Cannot parse

libphonenumber can also find numbers in text (findNumbers). In most of our examples it found the same numbers as extract. extract also reads kanji digits and skips numbers that do not fit the numbering plan or the MIC tables. Where one number ends and the next begins can also differ with the input and the findNumbers settings. For example, in 03-5253-8111/03-5253-8111, extract found two numbers and findNumbers found none.

Sources

libphonenumber's metadata for Japan lists the same MIC page among its sources, together with the ITU and a third-party website. Its rules are summarized as regular expressions, and the version of each source is not recorded. japan-phone generates its table by program from the MIC files and records the URL, SHA-256, and date of each file.

Using both

  • Use japan-phone to validate Japanese numbers strictly, and libphonenumber when you also handle numbers from other countries.
  • Pass numbers between them in E.164: japan-phone's international field.