Phone Number Formats by Country
Parse, validate, and format international phone numbers using libphonenumber-js โ a lightweight port of Google's libphonenumber. Supports E.164, International, National, and RFC3966 formats for 200+ countries.
Full International Dialing Directory
Browse every country calling code, local number format, and dialing guide on our dedicated phone reference site.
Live Phone Number Formatter
Type a phone number and select a country to see all output formats in real time.
๐บ๐ธUnited States +1
Enter in national format (e.g. 0712345678) or international (e.g. +44 7700 900123)
Could not parse phone number โ check format
Format Types Explained
+14155552671International standard used by APIs, databases, and SMS gateways. Always starts with + and country code. No spaces or dashes.
+1 415 555 2671Human-readable international format with spaces. Used in correspondence and UI display.
(415) 555-2671Local format without country code. Correct for domestic display within the country.
tel:+14155552671URI format for HTML href='tel:...' links and SIP protocol.
Implementation Guide
Install libphonenumber-js once, then use it anywhere in your Next.js app.
1. Install
npm install libphonenumber-js2. Parse a phone number
import { parsePhoneNumber } from "libphonenumber-js";
const phone = parsePhoneNumber("+14155552671");
console.log(phone.country); // "US"
console.log(phone.nationalNumber); // "4155552671"
console.log(phone.isValid()); // true3. Format output types
import { parsePhoneNumber } from "libphonenumber-js";
const phone = parsePhoneNumber("+14155552671");
phone.format("E.164"); // "+14155552671"
phone.format("INTERNATIONAL"); // "+1 415 555 2671"
phone.format("NATIONAL"); // "(415) 555-2671"
phone.format("RFC3966"); // "tel:+14155552671"4. Validate
import { isValidPhoneNumber } from "libphonenumber-js";
isValidPhoneNumber("+14155552671"); // true
isValidPhoneNumber("+14155552671", "US"); // true
isValidPhoneNumber("0412345678", "AU"); // true
isValidPhoneNumber("123", "US"); // false5. API Route (Next.js)
// app/api/validate-phone/route.ts
import { isValidPhoneNumber, parsePhoneNumber } from "libphonenumber-js";
import { NextResponse } from "next/server";
export async function POST(req: Request) {
const { phone, country } = await req.json();
if (!isValidPhoneNumber(phone, country)) {
return NextResponse.json({ valid: false }, { status: 400 });
}
const parsed = parsePhoneNumber(phone, country);
return NextResponse.json({
valid: true,
e164: parsed.format("E.164"),
international: parsed.format("INTERNATIONAL"),
national: parsed.format("NATIONAL"),
country: parsed.country,
});
}6. React validation hook
// hooks/use-phone-validation.ts
"use client";
import { isValidPhoneNumber, parsePhoneNumber, CountryCode } from "libphonenumber-js";
export function usePhoneValidation(value: string, country: CountryCode) {
const isValid = value.length > 3 && isValidPhoneNumber(value, country);
const parsed = isValid ? parsePhoneNumber(value, country) : null;
return {
isValid,
e164: parsed?.format("E.164") ?? null,
international: parsed?.format("INTERNATIONAL") ?? null,
national: parsed?.format("NATIONAL") ?? null,
};
}Implementation tips
- โStore as E.164. Always store phone numbers in E.164 format in your database. It is the only unambiguous, globally unique representation.
- โUse the min bundle. Import from
libphonenumber-js/minto reduce bundle size by ~40 %. - โDisplay nationally. When showing a number to a user in their own country, use
NATIONALformat. For cross-border, useINTERNATIONAL. - โServer-side validation. Never trust client-side validation alone. Validate E.164 format server-side before saving. The API route example above is the recommended pattern.
Country Dial Codes Directory
All ITU-T assigned country calling codes with example national numbers.
| Flag | Country | ISO | Dial Code | Example Number |
|---|---|---|---|---|
| ๐ฆ๐ซ | Afghanistan | AF | +93 | 0701234567 |
| ๐ฆ๐ฑ | Albania | AL | +355 | 0661234567 |
| ๐ฉ๐ฟ | Algeria | DZ | +213 | 0551234567 |
| ๐ฆ๐ฉ | Andorra | AD | +376 | 312345 |
| ๐ฆ๐ด | Angola | AO | +244 | 923123456 |
| ๐ฆ๐ท | Argentina | AR | +54 | 91123456789 |
| ๐ฆ๐ฒ | Armenia | AM | +374 | 077123456 |
| ๐ฆ๐บ | Australia | AU | +61 | 0412345678 |
| ๐ฆ๐น | Austria | AT | +43 | 0664123456 |
| ๐ฆ๐ฟ | Azerbaijan | AZ | +994 | 0401234567 |
| ๐ง๐ญ | Bahrain | BH | +973 | 36001234 |
| ๐ง๐ฉ | Bangladesh | BD | +880 | 01812345678 |
| ๐ง๐ช | Belgium | BE | +32 | 0470123456 |
| ๐ง๐ฏ | Benin | BJ | +229 | 90011234 |
| ๐ง๐น | Bhutan | BT | +975 | 17123456 |
| ๐ง๐ด | Bolivia | BO | +591 | 71234567 |
| ๐ง๐ฆ | Bosnia & Herzegovina | BA | +387 | 061123456 |
| ๐ง๐ผ | Botswana | BW | +267 | 71123456 |
| ๐ง๐ท | Brazil | BR | +55 | 11961234567 |
| ๐ง๐ณ | Brunei | BN | +673 | 7123456 |
| ๐ง๐ฌ | Bulgaria | BG | +359 | 0881234567 |
| ๐ง๐ซ | Burkina Faso | BF | +226 | 70123456 |
| ๐ฒ๐ฒ | Myanmar | MM | +95 | 09212345678 |
| ๐ง๐ฎ | Burundi | BI | +257 | 79561234 |
| ๐ฐ๐ญ | Cambodia | KH | +855 | 091234567 |
| ๐จ๐ฒ | Cameroon | CM | +237 | 671234567 |
| ๐จ๐ฆ | Canada | CA | +1 | 5062345678 |
| ๐จ๐ป | Cape Verde | CV | +238 | 9911234 |
| ๐จ๐ซ | Central African Republic | CF | +236 | 70012345 |
| ๐น๐ฉ | Chad | TD | +235 | 63012345 |
| ๐จ๐ฑ | Chile | CL | +56 | 221234567 |
| ๐จ๐ณ | China | CN | +86 | 13123456789 |
| ๐จ๐ด | Colombia | CO | +57 | 3211234567 |
| ๐จ๐ฉ | Congo (DRC) | CD | +243 | 0991234567 |
| ๐จ๐ท | Costa Rica | CR | +506 | 83123456 |
| ๐ญ๐ท | Croatia | HR | +385 | 0921234567 |
| ๐จ๐บ | Cuba | CU | +53 | 51234567 |
| ๐จ๐พ | Cyprus | CY | +357 | 96123456 |
| ๐จ๐ฟ | Czech Republic | CZ | +420 | 601123456 |
| ๐ฉ๐ฐ | Denmark | DK | +45 | 20123456 |
| ๐ฉ๐ฏ | Djibouti | DJ | +253 | 77831001 |
| ๐ฉ๐ด | Dominican Republic | DO | +1 | 8092345678 |
| ๐ช๐จ | Ecuador | EC | +593 | 0991234567 |
| ๐ช๐ฌ | Egypt | EG | +20 | 01001234567 |
| ๐ธ๐ป | El Salvador | SV | +503 | 70123456 |
| ๐ช๐ท | Eritrea | ER | +291 | 07123456 |
| ๐ช๐ช | Estonia | EE | +372 | 51234567 |
| ๐ช๐น | Ethiopia | ET | +251 | 0911234567 |
| ๐ซ๐ฎ | Finland | FI | +358 | 0412345678 |
| ๐ซ๐ท | France | FR | +33 | 0612345678 |
| ๐ฌ๐ฆ | Gabon | GA | +241 | 06031234 |
| ๐ฌ๐ฒ | Gambia | GM | +220 | 3012345 |
| ๐ฌ๐ช | Georgia | GE | +995 | 555123456 |
| ๐ฉ๐ช | Germany | DE | +49 | 15123456789 |
| ๐ฌ๐ญ | Ghana | GH | +233 | 0231234567 |
| ๐ฌ๐ท | Greece | GR | +30 | 6912345678 |
| ๐ฌ๐น | Guatemala | GT | +502 | 51234567 |
| ๐ฌ๐ณ | Guinea | GN | +224 | 601123456 |
| ๐ฌ๐ผ | Guinea-Bissau | GW | +245 | 955012345 |
| ๐ฌ๐พ | Guyana | GY | +592 | 6091234 |
| ๐ญ๐น | Haiti | HT | +509 | 34101234 |
| ๐ญ๐ณ | Honduras | HN | +504 | 91234567 |
| ๐ญ๐ฐ | Hong Kong | HK | +852 | 51234567 |
| ๐ญ๐บ | Hungary | HU | +36 | 20123456 |
| ๐ฎ๐ณ | India | IN | +91 | 8123456789 |
| ๐ฎ๐ฉ | Indonesia | ID | +62 | 081234567890 |
| ๐ฎ๐ท | Iran | IR | +98 | 09123456789 |
| ๐ฎ๐ถ | Iraq | IQ | +964 | 07901234567 |
| ๐ฎ๐ช | Ireland | IE | +353 | 0850123456 |
| ๐ฎ๐ฑ | Israel | IL | +972 | 0501234567 |
| ๐ฎ๐น | Italy | IT | +39 | 3123456789 |
| ๐ฏ๐ฒ | Jamaica | JM | +1 | 8762101234 |
| ๐ฏ๐ต | Japan | JP | +81 | 09012345678 |
| ๐ฏ๐ด | Jordan | JO | +962 | 0791234567 |
| ๐ฐ๐ฟ | Kazakhstan | KZ | +7 | 7710009998 |
| ๐ฐ๐ช | Kenya | KE | +254 | 0712345678 |
| ๐ฐ๐ท | South Korea | KR | +82 | 01012345678 |
| ๐ฐ๐ผ | Kuwait | KW | +965 | 50012345 |
| ๐ฐ๐ฌ | Kyrgyzstan | KG | +996 | 0700123456 |
| ๐ฑ๐ฆ | Laos | LA | +856 | 2023123456 |
| ๐ฑ๐ป | Latvia | LV | +371 | 21234567 |
| ๐ฑ๐ง | Lebanon | LB | +961 | 71123456 |
| ๐ฑ๐ธ | Lesotho | LS | +266 | 50123456 |
| ๐ฑ๐ท | Liberia | LR | +231 | 0770123456 |
| ๐ฑ๐พ | Libya | LY | +218 | 0912345678 |
| ๐ฑ๐ฎ | Liechtenstein | LI | +423 | 660234567 |
| ๐ฑ๐น | Lithuania | LT | +370 | 61234567 |
| ๐ฑ๐บ | Luxembourg | LU | +352 | 628123456 |
| ๐ฒ๐ด | Macao | MO | +853 | 66123456 |
| ๐ฒ๐ฐ | North Macedonia | MK | +389 | 072345678 |
| ๐ฒ๐ฌ | Madagascar | MG | +261 | 0321234567 |
| ๐ฒ๐ผ | Malawi | MW | +265 | 0991234567 |
| ๐ฒ๐พ | Malaysia | MY | +60 | 0123456789 |
| ๐ฒ๐ป | Maldives | MV | +960 | 7712345 |
| ๐ฒ๐ฑ | Mali | ML | +223 | 65012345 |
| ๐ฒ๐น | Malta | MT | +356 | 96912345 |
| ๐ฒ๐ท | Mauritania | MR | +222 | 22123456 |
| ๐ฒ๐ฝ | Mexico | MX | +52 | 5512345678 |
| ๐ฒ๐ฉ | Moldova | MD | +373 | 062512345 |
| ๐ฒ๐จ | Monaco | MC | +377 | 612345678 |
| ๐ฒ๐ณ | Mongolia | MN | +976 | 88123456 |
| ๐ฒ๐ช | Montenegro | ME | +382 | 067622901 |
| ๐ฒ๐ฆ | Morocco | MA | +212 | 0650123456 |
| ๐ฒ๐ฟ | Mozambique | MZ | +258 | 821234567 |
| ๐ณ๐ฆ | Namibia | NA | +264 | 0811234567 |
| ๐ณ๐ต | Nepal | NP | +977 | 9841234567 |
| ๐ณ๐ฑ | Netherlands | NL | +31 | 0612345678 |
| ๐ณ๐ฟ | New Zealand | NZ | +64 | 0211234567 |
| ๐ณ๐ฎ | Nicaragua | NI | +505 | 81234567 |
| ๐ณ๐ช | Niger | NE | +227 | 93123456 |
| ๐ณ๐ฌ | Nigeria | NG | +234 | 08021234567 |
| ๐ณ๐ด | Norway | NO | +47 | 40612345 |
| ๐ด๐ฒ | Oman | OM | +968 | 92123456 |
| ๐ต๐ฐ | Pakistan | PK | +92 | 03012345678 |
| ๐ต๐ฆ | Panama | PA | +507 | 61234567 |
| ๐ต๐ฌ | Papua New Guinea | PG | +675 | 70123456 |
| ๐ต๐พ | Paraguay | PY | +595 | 0961456789 |
| ๐ต๐ช | Peru | PE | +51 | 912345678 |
| ๐ต๐ญ | Philippines | PH | +63 | 09171234567 |
| ๐ต๐ฑ | Poland | PL | +48 | 512345678 |
| ๐ต๐น | Portugal | PT | +351 | 912345678 |
| ๐ถ๐ฆ | Qatar | QA | +974 | 33123456 |
| ๐ท๐ด | Romania | RO | +40 | 0712034567 |
| ๐ท๐บ | Russia | RU | +7 | 9123456789 |
| ๐ท๐ผ | Rwanda | RW | +250 | 0721123456 |
| ๐ธ๐ฆ | Saudi Arabia | SA | +966 | 0512345678 |
| ๐ธ๐ณ | Senegal | SN | +221 | 701234567 |
| ๐ท๐ธ | Serbia | RS | +381 | 0601234567 |
| ๐ธ๐ฑ | Sierra Leone | SL | +232 | 025123456 |
| ๐ธ๐ฌ | Singapore | SG | +65 | 81234567 |
| ๐ธ๐ฐ | Slovakia | SK | +421 | 0912123456 |
| ๐ธ๐ฎ | Slovenia | SI | +386 | 031234567 |
| ๐ธ๐ด | Somalia | SO | +252 | 0612345678 |
| ๐ฟ๐ฆ | South Africa | ZA | +27 | 0711234567 |
| ๐ช๐ธ | Spain | ES | +34 | 612345678 |
| ๐ฑ๐ฐ | Sri Lanka | LK | +94 | 0712345678 |
| ๐ธ๐ฉ | Sudan | SD | +249 | 0911231234 |
| ๐ธ๐ช | Sweden | SE | +46 | 0701234567 |
| ๐จ๐ญ | Switzerland | CH | +41 | 0781234567 |
| ๐ธ๐พ | Syria | SY | +963 | 0944567890 |
| ๐น๐ผ | Taiwan | TW | +886 | 0912345678 |
| ๐น๐ฏ | Tajikistan | TJ | +992 | 917123456 |
| ๐น๐ฟ | Tanzania | TZ | +255 | 0621234567 |
| ๐น๐ญ | Thailand | TH | +66 | 0812345678 |
| ๐น๐ฑ | Timor-Leste | TL | +670 | 77212345 |
| ๐น๐ฌ | Togo | TG | +228 | 90112345 |
| ๐น๐ณ | Tunisia | TN | +216 | 20123456 |
| ๐น๐ท | Turkey | TR | +90 | 05012345678 |
| ๐น๐ฒ | Turkmenistan | TM | +993 | 66123456 |
| ๐บ๐ฌ | Uganda | UG | +256 | 0712345678 |
| ๐บ๐ฆ | Ukraine | UA | +380 | 0501234567 |
| ๐ฆ๐ช | UAE | AE | +971 | 0501234567 |
| ๐ฌ๐ง | United Kingdom | GB | +44 | 07400123456 |
| ๐บ๐ธ | United States | US | +1 | 2015555555 |
| ๐บ๐พ | Uruguay | UY | +598 | 094231234 |
| ๐บ๐ฟ | Uzbekistan | UZ | +998 | 912345678 |
| ๐ป๐ช | Venezuela | VE | +58 | 04121234567 |
| ๐ป๐ณ | Vietnam | VN | +84 | 0912345678 |
| ๐พ๐ช | Yemen | YE | +967 | 0712345678 |
| ๐ฟ๐ฒ | Zambia | ZM | +260 | 0955123456 |
| ๐ฟ๐ผ | Zimbabwe | ZW | +263 | 0712345678 |
161 countries shown