Look up a number
Reference

UK phone number format — E.164, regex, rules

The complete UK phone number format reference: E.164 spec, the libphonenumber regex, valid prefixes, length rules, and a working JavaScript validator.

3 min read
Managing Director, OmegaIT · OmegaIT · Published 8 May 2026 · Updated 14/05/2026
On this page

If you are building software, cleansing a CRM, or running a UK ad campaign with a click-to-call button, you need a robust definition of a valid UK phone number. This guide is the engineering-grade reference: the E.164 spec, the libphonenumber-style regex, the prefix table, and a working JavaScript validator.

UK phone number lengths

FormatLength (incl. leading)Example
E.164 / international13 chars (+ + 12 digits) for most ranges; 12 for some 02X+442079460000
National (with leading 0)11 digits typical; 10 for some legacy02079460000
National (no leading 0)10 digits typical2079460000
With country code, no plus12 digits442079460000

UK phone number prefixes

PrefixTypeLength
01Geographic landline10-11
02Geographic landline (London 020 = 11; Cardiff 029 = 11; Belfast 028 = 11)11
03 (incl. 0303 / 0330 / 0333 / 0345 / 0344 / 0343)Non-geographic UK-rate11
055Corporate Numbering Service12
056Location-Independent Electronic Communications Service12
070Personal numbering11
071-075, 077-079Mobile (various MNOs)11
076Pager11
0800Freephone (legacy)10-11
0808Freephone11
0843-0845Service-charge11
0870-0873Service-charge11
09 (091X)Premium-rate11
116Harmonised European helpline6
118Directory enquiries6
999 / 112Emergency3

UK phone number regex (and why you probably should not write your own)

A good-enough UK regex for E.164:

Good-enough UK E.164 regex (~95% accurate)
^\+44(?:\d{9,10})$

And for national format:

Good-enough UK national-format regex (~95% accurate)
^0(?:1\d{8,9}|2\d{9}|3\d{9}|5\d{9}|7\d{9}|8\d{9}|9\d{9})$

Validating with libphonenumber-js

The right way, in TypeScript:

Production-grade UK phone number validator
import { parsePhoneNumberFromString } from "libphonenumber-js/min";

export function isValidUkNumber(input: string): boolean {
  const phone = parsePhoneNumberFromString(input, "GB");
  return Boolean(phone && phone.isValid() && phone.country === "GB");
}

export function toE164(input: string): string | null {
  const phone = parsePhoneNumberFromString(input, "GB");
  return phone && phone.isValid() ? phone.number : null;
}

export function toNational(input: string): string | null {
  const phone = parsePhoneNumberFromString(input, "GB");
  return phone && phone.isValid() ? phone.formatNational() : null;
}

The default country GB tells libphonenumber to assume UK national format when there is no leading +. The library handles every edge case in the table above plus a few you have not thought of (e.g. numbers with formatting characters from CSV exports).

E.164 specifically - what to store in your database

Numbers should be stored in international (E.164) format wherever possible. The format is unambiguous, fixed-length up to 15 digits, and supported by every conformant telephony API and inter-network signalling standard.
ITU-T Recommendation E.164

Store every UK number as E.164 (+44...). It is:

  • Globally unambiguous - +442079460000 is a London number anywhere on Earth.
  • Round-trippable - parsePhoneNumberFromString('+442079460000', 'GB').formatNational() gets you back to display format.
  • Index-friendly - fixed alphabet, no formatting variants to deduplicate.
  • Ready for SMS APIs - Twilio, Vonage, MessageBird all want E.164.

Display in national format on UI; store in E.164 in the database. Never the reverse.

International phone-number checker - UK and beyond

If you need to validate non-UK numbers in the same code path, libphonenumber-js covers 240+ countries out of the box. For server-side bulk validation at scale, a paid API like Twilio Lookup gives you carrier and line-type data on top of the format check - see UK phone number validation API for the comparison.

Bottom line

UK phone number format is well-defined but full of edge cases. Use libphonenumber-js for validation, store E.164 in your database, display national format on UI. The snippet above is sufficient for 99% of consumer apps; for bulk B2B work, see the API and CRM-cleansing guides linked above.

Look up a UK number now

Free, no signup. See the Ofcom range holder + AI internet check.

Frequently asked questions

What is the E.164 format for a UK phone number?

+44 followed by the national number with the leading 0 stripped. So 020 7946 0000 in national format becomes +442079460000 in E.164. UK E.164 numbers are typically 13 characters (the + plus 12 digits).

Is there a UK phone number regex?

A good-enough national-format regex covers 01, 02, 03, 05, 07, 08 and 09 prefixes with their typical 8-10 trailing digits. It will accept some invalid numbers (drama-reserved ranges, Recovered ranges) - for production, use libphonenumber-js, which bakes in the full Ofcom number plan.

What is the best UK phone number format checker?

For ad-hoc consumer checks, the form on this homepage. For developers, the libphonenumber-js library - it is the JavaScript port of Google industry-standard libphonenumber and bakes in every UK edge case.

Can I use the same code path to validate UK and international numbers?

Yes - libphonenumber-js handles 240+ countries. Pass the country code as a hint when parsing, or detect from the leading + (E.164) format.

Sources & references

  1. libphonenumber — Google's phone-number library
    Googlegithub.com/google/libphonenumber
  2. libphonenumber-js — JavaScript port
    @catamphetaminegithub.com/catamphetamine/libphonenumber-js
  3. National Telephone Numbering Plan
    Ofcomwww.ofcom.org.uk/phones-and-broadband/phone-numbers/numbering-policy/numbering-plan