A phone number validation API checks a number before you message or call it. Depending on the level, it confirms the format and country, identifies the line type and current carrier (MNP lookup), and checks with the mobile network whether the number is live (HLR lookup). Senders use it to clean lists, route to the right network, block risky sign-ups and avoid paying for messages that cannot be delivered.
What does a phone number validation API return?
Lookups come in levels, and each costs more and takes longer than the one before:
| Level | How it works | Returns | Speed and cost |
|---|---|---|---|
| Format validation | Rules from national numbering plans | Valid or not, country, E.164 form, possible type | Instant, often free (open-source libraries) |
| Line type and carrier | Numbering range and carrier databases | Mobile, landline, VoIP, toll-free; original carrier | Fast, low cost |
| MNP lookup | Number portability databases | Current carrier after porting, MCC/MNC | Fast, low cost, not available in every country |
| HLR lookup | Live query to the mobile network's subscriber register | Active or not, current network, sometimes roaming status | Slower, highest cost; mobile numbers only |
Format checks belong on every form. Carrier and line type checks are worth it at sign-up and for routing. HLR is for high-value checks and list cleaning. Details are in HLR lookup explained and VoIP number lookup.
Phone number validation vs verification: what is the difference?
Validation checks the number: is it real, what type, which network. Verification checks the person: they prove they control the number by entering a code sent by SMS or voice. A good sign-up flow does both, in that order: validate first so you do not send OTPs to invalid, landline or high-risk numbers, then verify with an OTP. See OTP SMS best practices.
What is an HLR lookup API used for?
- List cleaning: remove inactive numbers before a campaign so you do not pay for undeliverable messages.
- Routing: send each message to the route for the subscriber's current network, using MCC and MNC codes.
- Fraud checks: flag numbers that are not live or not on a mobile network at sign-up.
- Diagnosing delivery: when a message fails, check whether the number exists before blaming the route.
The registers behind these lookups are explained in HLR vs VLR.
How to choose a phone number validation API
- Coverage per country: MNP and HLR data quality differs a lot between countries; ask for coverage by country, not a global claim.
- Data freshness: how often carrier and portability data is updated.
- Accuracy on your traffic: test a sample of known numbers from your own users.
- Latency: sign-up checks need answers in well under a second; HLR can take longer.
- Pricing model: per lookup, per level; check whether failed or cached lookups are charged.
- Privacy: where queries are processed and how long numbers are stored.
Where to use validation in your flow
- On the form: format check as the user types, with the country preselected, and store numbers in E.164 format.
- On submit: line type and carrier lookup; block premium ranges and apply your policy for VoIP numbers.
- Before OTP: rate limits per number, IP and device, then send the code by SMS or by voice for landlines.
- Before campaigns: HLR or MNP lookups on old lists to remove inactive numbers and route to the right network.
Is phone number validation legal?
Checking format and carrier for your own users and contacts is common practice. HLR and similar network queries return technical status, not the owner's identity, but you still process personal data, so you need a lawful reason and must follow privacy law (for example the GDPR in the EU). Do not use lookups to profile people or to build lists of numbers you have no relationship with.
Pair validation with good routes
Validation reduces waste, and the right route delivers what is left. VoIPMatcher sources A2P SMS routes from its carriers and manages them for you. Request an SMS route.
Frequently asked questions
Is there a free phone number validation API?
Format validation can be free: open-source libraries such as Google's libphonenumber check number format and possible type offline. Carrier, portability and HLR data come from paid databases and network queries, so APIs that return them usually charge per lookup, sometimes with a small free trial.
What is the difference between HLR lookup and MNP lookup?
An MNP lookup checks portability databases to find a number's current operator. An HLR lookup queries the mobile network's subscriber register and can also tell whether the number is active. MNP is faster and cheaper; HLR gives live status but only for mobile numbers.
Can a validation API tell if a number is on WhatsApp?
Standard validation APIs return telecom data such as format, line type, carrier and network status. Whether a number uses a messaging app is not part of telecom lookups, and checking it without consent can break the app's terms and privacy rules.
How accurate is phone number validation?
Format checks are very accurate. Line type and carrier data are usually reliable for mobile versus landline but weaker for VoIP categories and recently ported or allocated numbers. HLR results are live but can fail when networks restrict queries. Test any provider on your own numbers.
Need a route?
Send the destination, route type and target rate. We reply with what we can deliver.