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.
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
| Format | Length (incl. leading) | Example |
|---|---|---|
| E.164 / international | 13 chars (+ + 12 digits) for most ranges; 12 for some 02X | +442079460000 |
| National (with leading 0) | 11 digits typical; 10 for some legacy | 02079460000 |
| National (no leading 0) | 10 digits typical | 2079460000 |
| With country code, no plus | 12 digits | 442079460000 |
UK phone number prefixes
| Prefix | Type | Length |
|---|---|---|
| 01 | Geographic landline | 10-11 |
| 02 | Geographic landline (London 020 = 11; Cardiff 029 = 11; Belfast 028 = 11) | 11 |
| 03 (incl. 0303 / 0330 / 0333 / 0345 / 0344 / 0343) | Non-geographic UK-rate | 11 |
| 055 | Corporate Numbering Service | 12 |
| 056 | Location-Independent Electronic Communications Service | 12 |
| 070 | Personal numbering | 11 |
| 071-075, 077-079 | Mobile (various MNOs) | 11 |
| 076 | Pager | 11 |
| 0800 | Freephone (legacy) | 10-11 |
| 0808 | Freephone | 11 |
| 0843-0845 | Service-charge | 11 |
| 0870-0873 | Service-charge | 11 |
| 09 (091X) | Premium-rate | 11 |
| 116 | Harmonised European helpline | 6 |
| 118 | Directory enquiries | 6 |
| 999 / 112 | Emergency | 3 |
UK phone number regex (and why you probably should not write your own)
A good-enough UK regex for E.164:
^\+44(?:\d{9,10})$And for national format:
^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:
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.
Store every UK number as E.164 (+44...). It is:
- Globally unambiguous -
+442079460000is 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
- ITU-T Recommendation E.164: international public telecommunication numbering planITUwww.itu.int/rec/T-REC-E.164
- libphonenumber — Google's phone-number libraryGooglegithub.com/google/libphonenumber
- libphonenumber-js — JavaScript port@catamphetaminegithub.com/catamphetamine/libphonenumber-js
- National Telephone Numbering PlanOfcomwww.ofcom.org.uk/phones-and-broadband/phone-numbers/numbering-policy/numbering-plan
Continue reading
- Validate a UK mobile number (2026 guide)How to validate a UK mobile number in 2026: format check, prefix check, libphonenumber-js code, plus carrier-aware paid APIs for bulk B2B work.
- UK phone number validation API — 2026 guideCompare the major UK phone number validation APIs (Twilio, Numverify, Vonage, MessageBird) on accuracy, cost, carrier data and Ofcom-equivalent coverage.
- UK number cleansing for CRM — 2026 playbookHow to cleanse a UK phone number list in your CRM: format normalisation, libphonenumber, carrier-aware deduplication, TPS suppression, and Ofcom-aware quality scoring.
- UK phone number checker — validate any UK numberA free UK phone number checker that does three jobs: validates the format, identifies the line type, and verifies the number against Ofcom + a live AI internet check. No signup.
- How Ofcom allocates UK phone numbersInside the National Telephone Numbering Plan: blocks, sub-allocations, porting, status flags, and the weekly numbering data feed that powers UK reverse lookups.