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.
On this page
Validating a UK mobile number sounds trivial — does it start with 07 and have 11 digits? — but a real validator needs to handle the 07 vs 070 distinction, recognise legacy pager and personal-numbering ranges, and reject numbers from blocks that aren't allocated for mobile service. This guide shows the manual rules, the libphonenumber-js code, and the right tool for bulk validation.
What counts as a UK mobile number
| Prefix | Type | Allocated to (typical) |
|---|---|---|
| 070 | Personal-numbering — NOT a mobile | Various |
| 071 | Mobile | Various MNOs |
| 072 | Mobile | Various MNOs |
| 073 | Mobile | Various MNOs |
| 074 | Mobile | Various MNOs |
| 075 | Mobile | Various MNOs |
| 076 | Pager (legacy) | Vodafone Pagers, BT Pagers |
| 077 | Mobile | Various MNOs |
| 078 | Mobile | Various MNOs |
| 079 | Mobile | Various MNOs |
Manual UK mobile validation rules
- Strip non-digits except a leading
+. - If the number starts
+44, replace with0. - If the number now has length 11 and starts
07, continue. Otherwise reject. - If the second-and-third digits are
0or6, reject (070 = personal-numbering, 076 = pager). - Optionally: cross-reference against the Ofcom range data to confirm the block is Allocated.
Programmatic UK mobile validation in JavaScript / TypeScript
import { parsePhoneNumberFromString } from "libphonenumber-js/min";
export function isValidUkMobile(input: string): boolean {
const phone = parsePhoneNumberFromString(input, "GB");
if (!phone || !phone.isValid() || phone.country !== "GB") return false;
return phone.getType() === "MOBILE";
}
export function toMobileE164(input: string): string | null {
return isValidUkMobile(input)
? parsePhoneNumberFromString(input, "GB")!.number
: null;
}getType() returns MOBILE only for the actual mobile prefixes (071–075, 077–079). 070 personal-numbering returns PERSONAL_NUMBER; 076 pager returns PAGER. That distinction is what hand-rolled regexes miss.
Validating in Python
import phonenumbers
from phonenumbers import PhoneNumberType
def is_valid_uk_mobile(value: str) -> bool:
try:
n = phonenumbers.parse(value, "GB")
except phonenumbers.NumberParseException:
return False
if not phonenumbers.is_valid_number(n):
return False
return phonenumbers.number_type(n) == PhoneNumberType.MOBILEValidating in PHP / Laravel
use libphonenumber\PhoneNumberUtil;
use libphonenumber\PhoneNumberType;
function isValidUkMobile(string $value): bool {
$util = PhoneNumberUtil::getInstance();
try {
$n = $util->parse($value, 'GB');
} catch (\Exception $e) {
return false;
}
return $util->isValidNumber($n)
&& $util->getNumberType($n) === PhoneNumberType::MOBILE;
}Carrier-aware validation — when format-check isn't enough
Format validation only tells you the number *could* be a real mobile. To find out whether it's *actually in service*, you need a carrier-aware API:
| Service | What it adds | Cost |
|---|---|---|
| Twilio Lookup (Line Type Intelligence) | Confirms current carrier (post-port) and live in-service status. | From $0.005/lookup |
| Numverify | Format + carrier, lighter weight. | Free tier 100/mo; from $14.99/mo |
| Vonage Number Insight | Adds roaming + reachability data. | From $0.005/lookup |
| MessageBird Lookup | Format + carrier, fast. | Free tier; usage-based |
For consumer apps that just need 'is this number well-formatted?', stick with libphonenumber-js — it's free and runs locally. For B2B applications where you're cleansing thousands of numbers, the carrier-aware APIs justify their cost. We cover the comparison in UK phone number validation API.
Validating mobile numbers for SMS marketing
Sending unsolicited marketing texts to a UK mobile without the recipient's consent (or a valid soft opt-in) is a breach of PECR. The ICO has issued multi-million-pound fines to organisations who run SMS campaigns without checking lawful basis.
If you're validating numbers for an SMS marketing list, three extras you need:
- Lawful basis — UK PECR + GDPR require opt-in (with very limited soft-opt-in exceptions). Validation alone doesn't grant consent.
- Number type = MOBILE — landlines can't receive SMS; sending to one wastes credits and triggers carrier complaints.
- Currency check — numbers can be ported between MNOs. Carrier-aware APIs catch ported numbers; pure format checks don't.
Bottom line
Validating a UK mobile number is two layers: a format check (libphonenumber-js, free, runs locally) and an in-service check (carrier-aware API, paid, runs over the network). Use the first for every signup form; add the second for bulk CRM cleansing or SMS marketing.
Look up a number right now
Type any UK number — Ofcom range holder + live AI internet check.
Frequently asked questions
How do I validate a UK mobile number programmatically?
Use libphonenumber-js (JavaScript / TypeScript), phonenumbers (Python), or libphonenumber-for-php (PHP). All three call into the same Google library and correctly distinguish mobile (071–075, 077–079) from personal-numbering (070) and pager (076).
How do I check if a UK number is valid?
Three layers: (1) format — strip punctuation and confirm 10 or 11 digits with a known UK prefix; (2) type — the first few digits identify the line type; (3) currency — paste it into our checker on the homepage to confirm it's in the latest Ofcom Numbering Data.
Is there a free UK phone number validator?
Yes — libphonenumber-js for developers, and the form at the top of this site for ad-hoc consumer checks. Both are free and require no signup.
What's the difference between a UK phone number validator and a UK number-checker app?
Format validators (libphonenumber-js) confirm the structure of the digits. Checkers add an in-service / Range Holder lookup. Carrier-aware paid APIs add a current-carrier check. Choose based on what question you're trying to answer.
Sources & references
- National Telephone Numbering PlanOfcomwww.ofcom.org.uk/phones-and-broadband/phone-numbers/numbering-policy/numbering-plan
- libphonenumber-js — JavaScript port@catamphetaminegithub.com/catamphetamine/libphonenumber-js
- libphonenumber — Google's phone-number libraryGooglegithub.com/google/libphonenumber
- Twilio Lookup API — Line Type IntelligenceTwiliowww.twilio.com/en-us/lookup
- Vonage Number Insight APIVonagedeveloper.vonage.com/en/number-insight/overview
Continue reading
- UK phone number formatThe complete UK phone number format reference: E.164 spec, the libphonenumber regex, valid prefixes, length rules, and a working JavaScript validator.
- UK number validation APICompare the major UK phone number validation APIs (Twilio, Numverify, Vonage, MessageBird) on accuracy, cost, carrier data and Ofcom-equivalent coverage.
- UK number cleansing (CRM)How to cleanse a UK phone-number list in your CRM — E.164 normalisation, libphonenumber validation, dedup, TPS suppression, carrier-aware checks.
- Free UK Phone Number Checker — Check Any UK NumberFree UK phone number checker. Paste any landline, mobile, freephone or service number to check it's valid, see the Ofcom range holder, and get a live AI scam-risk summary. No signup.
- 070 personal-numbering070 numbers look like UK mobiles but they're not. Calls cost up to 50p/min and scammers use them for ring-back fraud. Here's how to spot, block and report one.
- Check this phone numberNeed to check this phone number now? Paste it into our free UK phone number checker and see the Ofcom range holder, line type and live AI internet check in seconds.
- PAC codes & keeping your numberA PAC code lets you switch UK mobile network and keep your number. How to get one by texting PAC to 65075, how long it lasts, STAC vs PAC, and the full switch timeline — UK 2026 guide.
Related guides
- UK phone number format — E.164, regex, rulesReference
- UK phone number validation API — 2026 guideReference
- UK number cleansing for CRM — 2026 playbookReference
- UK short codes — 999, 112, 101, 105, 116Reference
- UK area codes — every 01/02 dialling codeReference
- 020 London — 0203, 0207, 0208, 0204 explainedReference
- Lookup any UK numberFree reverse phone lookup
- UK area codesEvery 01/02 dialling code
- Range holdersEvery Ofcom-listed provider
- FAQCommon WhoCalledLookup questions
- About WhoCalledLookupWho we are and our sources
- About the authorEditorial profile