Powered by libphonenumber-js

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.

200+Countries
4Format Types
ITU-TValidation
E.164Standard
Other Databases

Full International Dialing Directory

Browse every country calling code, local number format, and dialing guide on our dedicated phone reference site.

Visit countrycalling.codes

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)

Formatted Output

Could not parse phone number โ€” check format

Format Types Explained

E.164+14155552671

International standard used by APIs, databases, and SMS gateways. Always starts with + and country code. No spaces or dashes.

International+1 415 555 2671

Human-readable international format with spaces. Used in correspondence and UI display.

National(415) 555-2671

Local format without country code. Correct for domestic display within the country.

RFC3966tel:+14155552671

URI 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-js

2. 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());        // true

3. 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");         // false

5. 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/min to reduce bundle size by ~40 %.
  • โ€”Display nationally. When showing a number to a user in their own country, use NATIONAL format. For cross-border, use INTERNATIONAL.
  • โ€”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.

FlagCountryISODial CodeExample Number
๐Ÿ‡ฆ๐Ÿ‡ซAfghanistanAF+930701234567
๐Ÿ‡ฆ๐Ÿ‡ฑAlbaniaAL+3550661234567
๐Ÿ‡ฉ๐Ÿ‡ฟAlgeriaDZ+2130551234567
๐Ÿ‡ฆ๐Ÿ‡ฉAndorraAD+376312345
๐Ÿ‡ฆ๐Ÿ‡ดAngolaAO+244923123456
๐Ÿ‡ฆ๐Ÿ‡ทArgentinaAR+5491123456789
๐Ÿ‡ฆ๐Ÿ‡ฒArmeniaAM+374077123456
๐Ÿ‡ฆ๐Ÿ‡บAustraliaAU+610412345678
๐Ÿ‡ฆ๐Ÿ‡นAustriaAT+430664123456
๐Ÿ‡ฆ๐Ÿ‡ฟAzerbaijanAZ+9940401234567
๐Ÿ‡ง๐Ÿ‡ญBahrainBH+97336001234
๐Ÿ‡ง๐Ÿ‡ฉBangladeshBD+88001812345678
๐Ÿ‡ง๐Ÿ‡ชBelgiumBE+320470123456
๐Ÿ‡ง๐Ÿ‡ฏBeninBJ+22990011234
๐Ÿ‡ง๐Ÿ‡นBhutanBT+97517123456
๐Ÿ‡ง๐Ÿ‡ดBoliviaBO+59171234567
๐Ÿ‡ง๐Ÿ‡ฆBosnia & HerzegovinaBA+387061123456
๐Ÿ‡ง๐Ÿ‡ผBotswanaBW+26771123456
๐Ÿ‡ง๐Ÿ‡ทBrazilBR+5511961234567
๐Ÿ‡ง๐Ÿ‡ณBruneiBN+6737123456
๐Ÿ‡ง๐Ÿ‡ฌBulgariaBG+3590881234567
๐Ÿ‡ง๐Ÿ‡ซBurkina FasoBF+22670123456
๐Ÿ‡ฒ๐Ÿ‡ฒMyanmarMM+9509212345678
๐Ÿ‡ง๐Ÿ‡ฎBurundiBI+25779561234
๐Ÿ‡ฐ๐Ÿ‡ญCambodiaKH+855091234567
๐Ÿ‡จ๐Ÿ‡ฒCameroonCM+237671234567
๐Ÿ‡จ๐Ÿ‡ฆCanadaCA+15062345678
๐Ÿ‡จ๐Ÿ‡ปCape VerdeCV+2389911234
๐Ÿ‡จ๐Ÿ‡ซCentral African RepublicCF+23670012345
๐Ÿ‡น๐Ÿ‡ฉChadTD+23563012345
๐Ÿ‡จ๐Ÿ‡ฑChileCL+56221234567
๐Ÿ‡จ๐Ÿ‡ณChinaCN+8613123456789
๐Ÿ‡จ๐Ÿ‡ดColombiaCO+573211234567
๐Ÿ‡จ๐Ÿ‡ฉCongo (DRC)CD+2430991234567
๐Ÿ‡จ๐Ÿ‡ทCosta RicaCR+50683123456
๐Ÿ‡ญ๐Ÿ‡ทCroatiaHR+3850921234567
๐Ÿ‡จ๐Ÿ‡บCubaCU+5351234567
๐Ÿ‡จ๐Ÿ‡พCyprusCY+35796123456
๐Ÿ‡จ๐Ÿ‡ฟCzech RepublicCZ+420601123456
๐Ÿ‡ฉ๐Ÿ‡ฐDenmarkDK+4520123456
๐Ÿ‡ฉ๐Ÿ‡ฏDjiboutiDJ+25377831001
๐Ÿ‡ฉ๐Ÿ‡ดDominican RepublicDO+18092345678
๐Ÿ‡ช๐Ÿ‡จEcuadorEC+5930991234567
๐Ÿ‡ช๐Ÿ‡ฌEgyptEG+2001001234567
๐Ÿ‡ธ๐Ÿ‡ปEl SalvadorSV+50370123456
๐Ÿ‡ช๐Ÿ‡ทEritreaER+29107123456
๐Ÿ‡ช๐Ÿ‡ชEstoniaEE+37251234567
๐Ÿ‡ช๐Ÿ‡นEthiopiaET+2510911234567
๐Ÿ‡ซ๐Ÿ‡ฎFinlandFI+3580412345678
๐Ÿ‡ซ๐Ÿ‡ทFranceFR+330612345678
๐Ÿ‡ฌ๐Ÿ‡ฆGabonGA+24106031234
๐Ÿ‡ฌ๐Ÿ‡ฒGambiaGM+2203012345
๐Ÿ‡ฌ๐Ÿ‡ชGeorgiaGE+995555123456
๐Ÿ‡ฉ๐Ÿ‡ชGermanyDE+4915123456789
๐Ÿ‡ฌ๐Ÿ‡ญGhanaGH+2330231234567
๐Ÿ‡ฌ๐Ÿ‡ทGreeceGR+306912345678
๐Ÿ‡ฌ๐Ÿ‡นGuatemalaGT+50251234567
๐Ÿ‡ฌ๐Ÿ‡ณGuineaGN+224601123456
๐Ÿ‡ฌ๐Ÿ‡ผGuinea-BissauGW+245955012345
๐Ÿ‡ฌ๐Ÿ‡พGuyanaGY+5926091234
๐Ÿ‡ญ๐Ÿ‡นHaitiHT+50934101234
๐Ÿ‡ญ๐Ÿ‡ณHondurasHN+50491234567
๐Ÿ‡ญ๐Ÿ‡ฐHong KongHK+85251234567
๐Ÿ‡ญ๐Ÿ‡บHungaryHU+3620123456
๐Ÿ‡ฎ๐Ÿ‡ณIndiaIN+918123456789
๐Ÿ‡ฎ๐Ÿ‡ฉIndonesiaID+62081234567890
๐Ÿ‡ฎ๐Ÿ‡ทIranIR+9809123456789
๐Ÿ‡ฎ๐Ÿ‡ถIraqIQ+96407901234567
๐Ÿ‡ฎ๐Ÿ‡ชIrelandIE+3530850123456
๐Ÿ‡ฎ๐Ÿ‡ฑIsraelIL+9720501234567
๐Ÿ‡ฎ๐Ÿ‡นItalyIT+393123456789
๐Ÿ‡ฏ๐Ÿ‡ฒJamaicaJM+18762101234
๐Ÿ‡ฏ๐Ÿ‡ตJapanJP+8109012345678
๐Ÿ‡ฏ๐Ÿ‡ดJordanJO+9620791234567
๐Ÿ‡ฐ๐Ÿ‡ฟKazakhstanKZ+77710009998
๐Ÿ‡ฐ๐Ÿ‡ชKenyaKE+2540712345678
๐Ÿ‡ฐ๐Ÿ‡ทSouth KoreaKR+8201012345678
๐Ÿ‡ฐ๐Ÿ‡ผKuwaitKW+96550012345
๐Ÿ‡ฐ๐Ÿ‡ฌKyrgyzstanKG+9960700123456
๐Ÿ‡ฑ๐Ÿ‡ฆLaosLA+8562023123456
๐Ÿ‡ฑ๐Ÿ‡ปLatviaLV+37121234567
๐Ÿ‡ฑ๐Ÿ‡งLebanonLB+96171123456
๐Ÿ‡ฑ๐Ÿ‡ธLesothoLS+26650123456
๐Ÿ‡ฑ๐Ÿ‡ทLiberiaLR+2310770123456
๐Ÿ‡ฑ๐Ÿ‡พLibyaLY+2180912345678
๐Ÿ‡ฑ๐Ÿ‡ฎLiechtensteinLI+423660234567
๐Ÿ‡ฑ๐Ÿ‡นLithuaniaLT+37061234567
๐Ÿ‡ฑ๐Ÿ‡บLuxembourgLU+352628123456
๐Ÿ‡ฒ๐Ÿ‡ดMacaoMO+85366123456
๐Ÿ‡ฒ๐Ÿ‡ฐNorth MacedoniaMK+389072345678
๐Ÿ‡ฒ๐Ÿ‡ฌMadagascarMG+2610321234567
๐Ÿ‡ฒ๐Ÿ‡ผMalawiMW+2650991234567
๐Ÿ‡ฒ๐Ÿ‡พMalaysiaMY+600123456789
๐Ÿ‡ฒ๐Ÿ‡ปMaldivesMV+9607712345
๐Ÿ‡ฒ๐Ÿ‡ฑMaliML+22365012345
๐Ÿ‡ฒ๐Ÿ‡นMaltaMT+35696912345
๐Ÿ‡ฒ๐Ÿ‡ทMauritaniaMR+22222123456
๐Ÿ‡ฒ๐Ÿ‡ฝMexicoMX+525512345678
๐Ÿ‡ฒ๐Ÿ‡ฉMoldovaMD+373062512345
๐Ÿ‡ฒ๐Ÿ‡จMonacoMC+377612345678
๐Ÿ‡ฒ๐Ÿ‡ณMongoliaMN+97688123456
๐Ÿ‡ฒ๐Ÿ‡ชMontenegroME+382067622901
๐Ÿ‡ฒ๐Ÿ‡ฆMoroccoMA+2120650123456
๐Ÿ‡ฒ๐Ÿ‡ฟMozambiqueMZ+258821234567
๐Ÿ‡ณ๐Ÿ‡ฆNamibiaNA+2640811234567
๐Ÿ‡ณ๐Ÿ‡ตNepalNP+9779841234567
๐Ÿ‡ณ๐Ÿ‡ฑNetherlandsNL+310612345678
๐Ÿ‡ณ๐Ÿ‡ฟNew ZealandNZ+640211234567
๐Ÿ‡ณ๐Ÿ‡ฎNicaraguaNI+50581234567
๐Ÿ‡ณ๐Ÿ‡ชNigerNE+22793123456
๐Ÿ‡ณ๐Ÿ‡ฌNigeriaNG+23408021234567
๐Ÿ‡ณ๐Ÿ‡ดNorwayNO+4740612345
๐Ÿ‡ด๐Ÿ‡ฒOmanOM+96892123456
๐Ÿ‡ต๐Ÿ‡ฐPakistanPK+9203012345678
๐Ÿ‡ต๐Ÿ‡ฆPanamaPA+50761234567
๐Ÿ‡ต๐Ÿ‡ฌPapua New GuineaPG+67570123456
๐Ÿ‡ต๐Ÿ‡พParaguayPY+5950961456789
๐Ÿ‡ต๐Ÿ‡ชPeruPE+51912345678
๐Ÿ‡ต๐Ÿ‡ญPhilippinesPH+6309171234567
๐Ÿ‡ต๐Ÿ‡ฑPolandPL+48512345678
๐Ÿ‡ต๐Ÿ‡นPortugalPT+351912345678
๐Ÿ‡ถ๐Ÿ‡ฆQatarQA+97433123456
๐Ÿ‡ท๐Ÿ‡ดRomaniaRO+400712034567
๐Ÿ‡ท๐Ÿ‡บRussiaRU+79123456789
๐Ÿ‡ท๐Ÿ‡ผRwandaRW+2500721123456
๐Ÿ‡ธ๐Ÿ‡ฆSaudi ArabiaSA+9660512345678
๐Ÿ‡ธ๐Ÿ‡ณSenegalSN+221701234567
๐Ÿ‡ท๐Ÿ‡ธSerbiaRS+3810601234567
๐Ÿ‡ธ๐Ÿ‡ฑSierra LeoneSL+232025123456
๐Ÿ‡ธ๐Ÿ‡ฌSingaporeSG+6581234567
๐Ÿ‡ธ๐Ÿ‡ฐSlovakiaSK+4210912123456
๐Ÿ‡ธ๐Ÿ‡ฎSloveniaSI+386031234567
๐Ÿ‡ธ๐Ÿ‡ดSomaliaSO+2520612345678
๐Ÿ‡ฟ๐Ÿ‡ฆSouth AfricaZA+270711234567
๐Ÿ‡ช๐Ÿ‡ธSpainES+34612345678
๐Ÿ‡ฑ๐Ÿ‡ฐSri LankaLK+940712345678
๐Ÿ‡ธ๐Ÿ‡ฉSudanSD+2490911231234
๐Ÿ‡ธ๐Ÿ‡ชSwedenSE+460701234567
๐Ÿ‡จ๐Ÿ‡ญSwitzerlandCH+410781234567
๐Ÿ‡ธ๐Ÿ‡พSyriaSY+9630944567890
๐Ÿ‡น๐Ÿ‡ผTaiwanTW+8860912345678
๐Ÿ‡น๐Ÿ‡ฏTajikistanTJ+992917123456
๐Ÿ‡น๐Ÿ‡ฟTanzaniaTZ+2550621234567
๐Ÿ‡น๐Ÿ‡ญThailandTH+660812345678
๐Ÿ‡น๐Ÿ‡ฑTimor-LesteTL+67077212345
๐Ÿ‡น๐Ÿ‡ฌTogoTG+22890112345
๐Ÿ‡น๐Ÿ‡ณTunisiaTN+21620123456
๐Ÿ‡น๐Ÿ‡ทTurkeyTR+9005012345678
๐Ÿ‡น๐Ÿ‡ฒTurkmenistanTM+99366123456
๐Ÿ‡บ๐Ÿ‡ฌUgandaUG+2560712345678
๐Ÿ‡บ๐Ÿ‡ฆUkraineUA+3800501234567
๐Ÿ‡ฆ๐Ÿ‡ชUAEAE+9710501234567
๐Ÿ‡ฌ๐Ÿ‡งUnited KingdomGB+4407400123456
๐Ÿ‡บ๐Ÿ‡ธUnited StatesUS+12015555555
๐Ÿ‡บ๐Ÿ‡พUruguayUY+598094231234
๐Ÿ‡บ๐Ÿ‡ฟUzbekistanUZ+998912345678
๐Ÿ‡ป๐Ÿ‡ชVenezuelaVE+5804121234567
๐Ÿ‡ป๐Ÿ‡ณVietnamVN+840912345678
๐Ÿ‡พ๐Ÿ‡ชYemenYE+9670712345678
๐Ÿ‡ฟ๐Ÿ‡ฒZambiaZM+2600955123456
๐Ÿ‡ฟ๐Ÿ‡ผZimbabweZW+2630712345678

161 countries shown