[{"data":1,"prerenderedAt":866,"buildId":867},["ShallowReactive",2],{"docs-navigation-en":3,"examples-en":30,"page-\u002Fdocs\u002Fgetting-started":131,"surround-\u002Fdocs\u002Fgetting-started":862},[4],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Docs","\u002Fdocs","docs",[9,13,17,21,25],{"title":10,"path":11,"stem":12},"Getting started","\u002Fdocs\u002Fgetting-started","docs\u002F1.getting-started",{"title":14,"path":15,"stem":16},"In the browser and with frameworks","\u002Fdocs\u002Fin-the-browser","docs\u002F2.in-the-browser",{"title":18,"path":19,"stem":20},"Input rules","\u002Fdocs\u002Finput-rules","docs\u002F3.input-rules",{"title":22,"path":23,"stem":24},"Compared with libphonenumber","\u002Fdocs\u002Flibphonenumber","docs\u002F4.libphonenumber",{"title":26,"path":27,"stem":28},"Data and sources","\u002Fdocs\u002Fdata-and-sources","docs\u002F5.data-and-sources",false,[31,40,47,55,63,71,77,84,92,98,104,110,117,125],{"path":32,"title":33,"description":34,"category":35,"order":36,"uses":37,"demo":39},"\u002Fexamples\u002Fvalidate-input","Validate a phone number field","Accept full-width input, reject numbers that do not exist, and save one notation.","forms",1,[38],"normalize","validate-input",{"path":41,"title":42,"description":43,"category":35,"order":44,"uses":45,"demo":46},"\u002Fexamples\u002Fpaste-labels","Accept pasted labels and notes","Take the main number from lines like ",2,[38],"paste-labels",{"path":48,"title":49,"description":50,"category":35,"order":51,"uses":52,"demo":54},"\u002Fexamples\u002Fmobile-only","Accept mobile numbers only","Use the type to decide whether a number can receive SMS.",3,[38,53],"type","mobile-only",{"path":56,"title":57,"description":58,"category":35,"order":59,"uses":60,"demo":62},"\u002Fexamples\u002Ftel-link","Make tel: links","Link numbers in their international form, and keep domestic-only numbers dialable.",4,[38,61],"international","tel-link",{"path":64,"title":65,"description":66,"category":67,"order":36,"uses":68,"demo":70},"\u002Fexamples\u002Fextract-inquiry","Find numbers in a message","Pick every phone number out of a message, in the order it appears.","text",[69],"extract","extract-inquiry",{"path":72,"title":73,"description":74,"category":67,"order":44,"uses":75,"demo":76},"\u002Fexamples\u002Fbusiness-card","Read a business card in kanji digits","Find numbers written with 〇一二三, as on vertical business cards.",[69],"business-card",{"path":78,"title":79,"description":80,"category":67,"order":51,"uses":81,"demo":83},"\u002Fexamples\u002Fcompany-page","List the numbers on a company page","Find TEL and FAX numbers and drop duplicates written in other notations.",[69,82],"digits","company-page",{"path":85,"title":86,"description":87,"category":88,"order":36,"uses":89,"demo":91},"\u002Fexamples\u002Fdisplay-format","Store digits, show hyphens","Format stored digits with the groups from the numbering table.","data",[38,90],"national","display-format",{"path":93,"title":94,"description":95,"category":88,"order":44,"uses":96,"demo":97},"\u002Fexamples\u002Fdedupe","Find duplicates written differently","Group entries that are the same number in different notations.",[38],"dedupe",{"path":99,"title":100,"description":101,"category":88,"order":51,"uses":102,"demo":103},"\u002Fexamples\u002Fcsv-cleanup","Clean a CSV column","Rewrite a phone column in one notation and flag rows that need a person.",[38],"csv-cleanup",{"path":105,"title":106,"description":107,"category":88,"order":59,"uses":108,"demo":109},"\u002Fexamples\u002Ftype-stats","Count numbers by type","See how many entries are mobile, fixed-line, toll-free, or invalid.",[38,53],"type-stats",{"path":111,"title":112,"description":113,"category":88,"order":114,"uses":115,"demo":116},"\u002Fexamples\u002Fe164","Convert to E.164","Pass numbers to SMS gateways, CRMs, and libphonenumber in international form.",5,[38,61],"e164",{"path":118,"title":119,"description":120,"category":121,"order":36,"uses":122,"demo":124},"\u002Fexamples\u002Fplan-check","Reject numbers that cannot exist","Numbers missing from the numbering plan or the MIC tables are invalid.","rules",[123],"isValid","plan-check",{"path":126,"title":127,"description":128,"category":121,"order":44,"uses":129,"demo":130},"\u002Fexamples\u002Finternational-input","Read numbers written for abroad","Accept +81 notation, including the bracketed (0), for the types that can be dialed from abroad.",[38],"international-input",{"id":132,"title":10,"body":133,"description":857,"extension":858,"meta":859,"navigation":417,"path":11,"seo":860,"stem":12,"__hash__":861},"docs_en\u002Fdocs\u002F1.getting-started.md",{"type":134,"value":135,"toc":851},"minimark",[136,140,145,275,282,286,361,707,711,802,840,844,847],[137,138,139],"p",{},"japan-phone validates and formats Japanese phone numbers using only the numbering plan and the fixed-line tables published by the Ministry of Internal Affairs and Communications (MIC). The Node.js, Python, and Java libraries bundle the same table, pass the same tests, and return the same results. They need no network access and have no runtime dependencies.",[141,142,144],"h2",{"id":143},"install","Install",[146,147,148,173,188],"code-group",{},[149,150,156],"pre",{"className":151,"code":152,"filename":153,"language":154,"meta":155,"style":155},"language-bash shiki shiki-themes material-theme-lighter github-light github-dark","npm install @kurashina-design\u002Fjapan-phone\n","npm","bash","",[157,158,159],"code",{"__ignoreMap":155},[160,161,163,166,170],"span",{"class":162,"line":36},"line",[160,164,153],{"class":165},"sbgvK",[160,167,169],{"class":168},"s_sjI"," install",[160,171,172],{"class":168}," @kurashina-design\u002Fjapan-phone\n",[149,174,177],{"className":151,"code":175,"filename":176,"language":154,"meta":155,"style":155},"pip install japan-phone\n","pip",[157,178,179],{"__ignoreMap":155},[160,180,181,183,185],{"class":162,"line":36},[160,182,176],{"class":165},[160,184,169],{"class":168},[160,186,187],{"class":168}," japan-phone\n",[149,189,194],{"className":190,"code":191,"filename":192,"language":193,"meta":155,"style":155},"language-xml shiki shiki-themes material-theme-lighter github-light github-dark","\u003Cdependency>\n  \u003CgroupId>jp.kurashina\u003C\u002FgroupId>\n  \u003CartifactId>japan-phone\u003C\u002FartifactId>\n  \u003Cversion>0.9.0\u003C\u002Fversion>\n\u003C\u002Fdependency>\n","Maven","xml",[157,195,196,209,231,249,267],{"__ignoreMap":155},[160,197,198,202,206],{"class":162,"line":36},[160,199,201],{"class":200},"sP7_E","\u003C",[160,203,205],{"class":204},"sQzsp","dependency",[160,207,208],{"class":200},">\n",[160,210,211,214,217,220,224,227,229],{"class":162,"line":44},[160,212,213],{"class":200},"  \u003C",[160,215,216],{"class":204},"groupId",[160,218,219],{"class":200},">",[160,221,223],{"class":222},"su5hD","jp.kurashina",[160,225,226],{"class":200},"\u003C\u002F",[160,228,216],{"class":204},[160,230,208],{"class":200},[160,232,233,235,238,240,243,245,247],{"class":162,"line":51},[160,234,213],{"class":200},[160,236,237],{"class":204},"artifactId",[160,239,219],{"class":200},[160,241,242],{"class":222},"japan-phone",[160,244,226],{"class":200},[160,246,237],{"class":204},[160,248,208],{"class":200},[160,250,251,253,256,258,261,263,265],{"class":162,"line":59},[160,252,213],{"class":200},[160,254,255],{"class":204},"version",[160,257,219],{"class":200},[160,259,260],{"class":222},"0.9.0",[160,262,226],{"class":200},[160,264,255],{"class":204},[160,266,208],{"class":200},[160,268,269,271,273],{"class":162,"line":114},[160,270,226],{"class":200},[160,272,205],{"class":204},[160,274,208],{"class":200},[137,276,277,278,281],{},"Node.js 22 or later, Python 3.11 or later, and Java 8 or later are supported. Each is the oldest release line that still receives security updates. The npm package also runs in browsers (",[279,280,14],"a",{"href":15},").",[141,283,285],{"id":284},"three-functions","Three functions",[287,288,289,305],"table",{},[290,291,292],"thead",{},[293,294,295,299,302],"tr",{},[296,297,298],"th",{},"Function",[296,300,301],{},"Use it for",[296,303,304],{},"Not a phone number",[306,307,308,330,349],"tbody",{},[293,309,310,315,318],{},[311,312,313],"td",{},[157,314,38],{},[311,316,317],{},"One value, such as a form field",[311,319,320,323,324,323,327],{},[157,321,322],{},"null"," · ",[157,325,326],{},"None",[157,328,329],{},"Optional.empty()",[293,331,332,341,344],{},[311,333,334,336,337,340],{},[157,335,123],{}," (",[157,338,339],{},"is_valid",")",[311,342,343],{},"A yes-or-no check",[311,345,346],{},[157,347,348],{},"false",[293,350,351,355,358],{},[311,352,353],{},[157,354,69],{},[311,356,357],{},"Free text with any number of phone numbers",[311,359,360],{},"An empty list",[146,362,363,492,588],{},[149,364,369],{"className":365,"code":366,"filename":367,"language":368,"meta":155,"style":155},"language-js shiki shiki-themes material-theme-lighter github-light github-dark","import { normalize, isValid, extract } from \"@kurashina-design\u002Fjapan-phone\";\n\nnormalize(\"〇九〇－一二三四－五六七八\");\n\u002F\u002F { national: \"090-1234-5678\", digits: \"09012345678\",\n\u002F\u002F   international: \"+819012345678\", type: \"mobile\" }\nisValid(\"03-1234-5678\"); \u002F\u002F false\nextract(\"日中は090-1234-5678、夜は092-513-5612まで\"); \u002F\u002F two results\n","Node.js","js",[157,370,371,413,419,438,444,449,471],{"__ignoreMap":155},[160,372,373,377,380,383,386,389,391,394,397,400,404,407,410],{"class":162,"line":36},[160,374,376],{"class":375},"sVHd0","import",[160,378,379],{"class":200}," {",[160,381,382],{"class":222}," normalize",[160,384,385],{"class":200},",",[160,387,388],{"class":222}," isValid",[160,390,385],{"class":200},[160,392,393],{"class":222}," extract",[160,395,396],{"class":200}," }",[160,398,399],{"class":375}," from",[160,401,403],{"class":402},"sjJ54"," \"",[160,405,406],{"class":168},"@kurashina-design\u002Fjapan-phone",[160,408,409],{"class":402},"\"",[160,411,412],{"class":200},";\n",[160,414,415],{"class":162,"line":44},[160,416,418],{"emptyLinePlaceholder":417},true,"\n",[160,420,421,424,427,429,432,434,436],{"class":162,"line":51},[160,422,38],{"class":423},"sGLFI",[160,425,426],{"class":222},"(",[160,428,409],{"class":402},[160,430,431],{"class":168},"〇九〇－一二三四－五六七八",[160,433,409],{"class":402},[160,435,340],{"class":222},[160,437,412],{"class":200},[160,439,440],{"class":162,"line":59},[160,441,443],{"class":442},"sutJx","\u002F\u002F { national: \"090-1234-5678\", digits: \"09012345678\",\n",[160,445,446],{"class":162,"line":114},[160,447,448],{"class":442},"\u002F\u002F   international: \"+819012345678\", type: \"mobile\" }\n",[160,450,452,454,456,458,461,463,465,468],{"class":162,"line":451},6,[160,453,123],{"class":423},[160,455,426],{"class":222},[160,457,409],{"class":402},[160,459,460],{"class":168},"03-1234-5678",[160,462,409],{"class":402},[160,464,340],{"class":222},[160,466,467],{"class":200},";",[160,469,470],{"class":442}," \u002F\u002F false\n",[160,472,474,476,478,480,483,485,487,489],{"class":162,"line":473},7,[160,475,69],{"class":423},[160,477,426],{"class":222},[160,479,409],{"class":402},[160,481,482],{"class":168},"日中は090-1234-5678、夜は092-513-5612まで",[160,484,409],{"class":402},[160,486,340],{"class":222},[160,488,467],{"class":200},[160,490,491],{"class":442}," \u002F\u002F two results\n",[149,493,498],{"className":494,"code":495,"filename":496,"language":497,"meta":155,"style":155},"language-python shiki shiki-themes material-theme-lighter github-light github-dark","from japan_phone import extract, is_valid, normalize\n\nnormalize(\"〇九〇－一二三四－五六七八\").national  # \"090-1234-5678\"\nis_valid(\"03-1234-5678\")  # False\nlen(extract(\"日中は090-1234-5678、夜は092-513-5612まで\"))  # 2\n","Python","python",[157,499,500,522,526,547,564],{"__ignoreMap":155},[160,501,502,505,508,510,512,514,517,519],{"class":162,"line":36},[160,503,504],{"class":375},"from",[160,506,507],{"class":222}," japan_phone ",[160,509,376],{"class":375},[160,511,393],{"class":222},[160,513,385],{"class":200},[160,515,516],{"class":222}," is_valid",[160,518,385],{"class":200},[160,520,521],{"class":222}," normalize\n",[160,523,524],{"class":162,"line":44},[160,525,418],{"emptyLinePlaceholder":417},[160,527,528,531,533,535,537,539,541,544],{"class":162,"line":51},[160,529,38],{"class":530},"slqww",[160,532,426],{"class":200},[160,534,409],{"class":402},[160,536,431],{"class":168},[160,538,409],{"class":402},[160,540,281],{"class":200},[160,542,90],{"class":543},"skxfh",[160,545,546],{"class":442},"  # \"090-1234-5678\"\n",[160,548,549,551,553,555,557,559,561],{"class":162,"line":59},[160,550,339],{"class":530},[160,552,426],{"class":200},[160,554,409],{"class":402},[160,556,460],{"class":168},[160,558,409],{"class":402},[160,560,340],{"class":200},[160,562,563],{"class":442},"  # False\n",[160,565,566,570,572,574,576,578,580,582,585],{"class":162,"line":114},[160,567,569],{"class":568},"sptTA","len",[160,571,426],{"class":200},[160,573,69],{"class":530},[160,575,426],{"class":200},[160,577,409],{"class":402},[160,579,482],{"class":168},[160,581,409],{"class":402},[160,583,584],{"class":200},"))",[160,586,587],{"class":442},"  # 2\n",[149,589,594],{"className":590,"code":591,"filename":592,"language":593,"meta":155,"style":155},"language-java shiki shiki-themes material-theme-lighter github-light github-dark","import jp.kurashina.japanphone.JapanPhone;\n\nJapanPhone.normalize(\"〇九〇－一二三四－五六七八\").get().getNational(); \u002F\u002F \"090-1234-5678\"\nJapanPhone.isValid(\"03-1234-5678\"); \u002F\u002F false\nJapanPhone.extract(\"日中は090-1234-5678、夜は092-513-5612まで\").size(); \u002F\u002F 2\n","Java","java",[157,595,596,623,627,660,681],{"__ignoreMap":155},[160,597,598,601,605,608,611,613,616,618,621],{"class":162,"line":36},[160,599,376],{"class":600},"sw1J6",[160,602,604],{"class":603},"s_bVq"," jp",[160,606,607],{"class":200},".",[160,609,610],{"class":603},"kurashina",[160,612,607],{"class":200},[160,614,615],{"class":603},"japanphone",[160,617,607],{"class":200},[160,619,620],{"class":603},"JapanPhone",[160,622,412],{"class":200},[160,624,625],{"class":162,"line":44},[160,626,418],{"emptyLinePlaceholder":417},[160,628,629,631,633,635,637,639,641,643,645,648,651,654,657],{"class":162,"line":51},[160,630,620],{"class":222},[160,632,607],{"class":200},[160,634,38],{"class":423},[160,636,426],{"class":200},[160,638,409],{"class":402},[160,640,431],{"class":168},[160,642,409],{"class":402},[160,644,281],{"class":200},[160,646,647],{"class":423},"get",[160,649,650],{"class":200},"().",[160,652,653],{"class":423},"getNational",[160,655,656],{"class":200},"();",[160,658,659],{"class":442}," \u002F\u002F \"090-1234-5678\"\n",[160,661,662,664,666,668,670,672,674,676,679],{"class":162,"line":59},[160,663,620],{"class":222},[160,665,607],{"class":200},[160,667,123],{"class":423},[160,669,426],{"class":200},[160,671,409],{"class":402},[160,673,460],{"class":168},[160,675,409],{"class":402},[160,677,678],{"class":200},");",[160,680,470],{"class":442},[160,682,683,685,687,689,691,693,695,697,699,702,704],{"class":162,"line":114},[160,684,620],{"class":222},[160,686,607],{"class":200},[160,688,69],{"class":423},[160,690,426],{"class":200},[160,692,409],{"class":402},[160,694,482],{"class":168},[160,696,409],{"class":402},[160,698,281],{"class":200},[160,700,701],{"class":423},"size",[160,703,656],{"class":200},[160,705,706],{"class":442}," \u002F\u002F 2\n",[141,708,710],{"id":709},"the-result","The result",[287,712,713,726],{},[290,714,715],{},[293,716,717,720,723],{},[296,718,719],{},"Field",[296,721,722],{},"Example",[296,724,725],{},"Meaning",[306,727,728,742,759,773],{},[293,729,730,734,739],{},[311,731,732],{},[157,733,90],{},[311,735,736],{},[157,737,738],{},"03-5253-8111",[311,740,741],{},"The domestic notation with hyphens",[293,743,744,748,753],{},[311,745,746],{},[157,747,82],{},[311,749,750],{},[157,751,752],{},"0352538111",[311,754,755,756],{},"Digits only, with the leading ",[157,757,758],{},"0",[293,760,761,765,770],{},[311,762,763],{},[157,764,61],{},[311,766,767],{},[157,768,769],{},"+81352538111",[311,771,772],{},"E.164. Empty for 0120, 0800, and 0570",[293,774,775,779,784],{},[311,776,777],{},[157,778,53],{},[311,780,781],{},[157,782,783],{},"fixed_line",[311,785,786,788,789,788,792,788,795,798,799],{},[157,787,783],{},", ",[157,790,791],{},"mobile",[157,793,794],{},"ip_phone",[157,796,797],{},"toll_free",", or ",[157,800,801],{},"unified_number",[137,803,804,805,808,809,812,813,816,817,820,821,824,825,828,829,832,833,835,836,839],{},"In Java, read the fields with getters. ",[157,806,807],{},"getInternational()"," returns ",[157,810,811],{},"Optional\u003CString>",". ",[157,814,815],{},"getType()"," returns the ",[157,818,819],{},"JapanPhoneType"," enum (",[157,822,823],{},"FIXED_LINE"," and so on); its ",[157,826,827],{},"getValue()"," and ",[157,830,831],{},"toString()"," return the same string as the other languages, such as ",[157,834,783],{},". Two results are ",[157,837,838],{},"equals"," when all their fields are equal.",[141,841,843],{"id":842},"what-valid-means","What \"valid\" means",[137,845,846],{},"A valid number has the structure of a supported type and belongs to a block in the numbering plan or the MIC tables. It does not mean that the number is subscribed, reachable, or able to receive SMS. Check that with your telephony or SMS provider.",[848,849,850],"style",{},"html pre.shiki code .sbgvK, html code.shiki .sbgvK{--shiki-light:#E2931D;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s_sjI, html code.shiki .s_sjI{--shiki-light:#91B859;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sP7_E, html code.shiki .sP7_E{--shiki-light:#39ADB5;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sQzsp, html code.shiki .sQzsp{--shiki-light:#E53935;--shiki-default:#22863A;--shiki-dark:#85E89D}html pre.shiki code .su5hD, html code.shiki .su5hD{--shiki-light:#90A4AE;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sVHd0, html code.shiki .sVHd0{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#D73A49;--shiki-default-font-style:inherit;--shiki-dark:#F97583;--shiki-dark-font-style:inherit}html pre.shiki code .sjJ54, html code.shiki .sjJ54{--shiki-light:#39ADB5;--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sGLFI, html code.shiki .sGLFI{--shiki-light:#6182B8;--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sutJx, html code.shiki .sutJx{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#6A737D;--shiki-default-font-style:inherit;--shiki-dark:#6A737D;--shiki-dark-font-style:inherit}html pre.shiki code .slqww, html code.shiki .slqww{--shiki-light:#6182B8;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .skxfh, html code.shiki .skxfh{--shiki-light:#E53935;--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sptTA, html code.shiki .sptTA{--shiki-light:#6182B8;--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sw1J6, html code.shiki .sw1J6{--shiki-light:#F76D47;--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .s_bVq, html code.shiki .s_bVq{--shiki-light:#9C3EDA;--shiki-default:#24292E;--shiki-dark:#E1E4E8}",{"title":155,"searchDepth":44,"depth":44,"links":852},[853,854,855,856],{"id":143,"depth":44,"text":144},{"id":284,"depth":44,"text":285},{"id":709,"depth":44,"text":710},{"id":842,"depth":44,"text":843},"Install japan-phone for Node.js, Python, or Java and learn its three functions.","md",{},{"title":10,"description":857},"Gss7HxZItZgQS3UmOznAb4UFeP3ILcvU98wlrYihXqk",[863,864],null,{"title":14,"path":15,"stem":16,"description":865,"children":-1},"The npm package runs unchanged in the browser. Examples for an input field in Vue and React.",1796483607422,"73e0e014-4aa7-4f04-8db5-5f7391793162"]