Validity rules

Read numbers written for abroad

normalize
Accept +81 notation, including the bracketed (0), for the types that can be dialed from abroad.
Try it
  • 050-3818-1250
  • 090-1234-5678
  • 03-5253-8111
  • rejected
  • rejected

How it works

Numbers on English pages are often written as +81-(0)50-3818-1250 or +81 90-1234-5678. normalize accepts +81 for fixed-line, mobile, and 050 numbers, and drops the bracketed domestic 0.

  • Toll-free and 0570 numbers cannot be dialed from abroad, so +81 120 123 456 is rejected.
  • +810352538111, with the 0 kept but not in brackets, is rejected as a broken notation.

In each language

import { normalize } from "@kurashina-design/japan-phone";

// Numbers written for callers abroad.
const inputs = ["+81-(0)50-3818-1250", "+81 90-1234-5678", "+81-3-5253-8111", "+81 120 123 456", "+810352538111"];
for (const input of inputs) console.log(input, "->", normalize(input)?.national ?? "rejected");

Output:

+81-(0)50-3818-1250 -> 050-3818-1250
+81 90-1234-5678 -> 090-1234-5678
+81-3-5253-8111 -> 03-5253-8111
+81 120 123 456 -> rejected
+810352538111 -> rejected