Phone Number Validation Best Practices

Phone validation ensures numbers in your database are real, reachable, and correctly formatted. Following best practices prevents wasted outreach, improves deliverability, and reduces fraud risk.

Key Takeaways

  • Validate format, validity, and reachability separately
  • Check line type before SMS campaigns (landlines can't receive texts)
  • Use real-time validation during form submission
  • Periodically refresh stale data in your database

Validation Levels

Phone validation operates at multiple levels, from simple format checks to carrier-level verification:

1. Format Validation

Check that the number follows correct formatting:

  • Length — US numbers are 10 digits (+ country code)
  • Country code — +1 for US/Canada
  • Area code — Valid NPA (area code)
  • Invalid prefixes — No 555-01xx (reserved for fiction)
# Format validation example
import re

def is_valid_format(phone):
    # Remove non-digits
    digits = re.sub(r'\D', '', phone)

    # Check length (10 or 11 with country code)
    if len(digits) == 11 and digits[0] == '1':
        digits = digits[1:]
    if len(digits) != 10:
        return False

    # Check for invalid area codes
    area_code = digits[:3]
    if area_code.startswith('0') or area_code.startswith('1'):
        return False

    return True

2. Validity Checking

Verify the number exists in carrier databases:

  • LRN lookup — Confirms number is assigned to a carrier
  • Active status — Number is not disconnected
  • Line type — Wireless, landline, or VoIP

3. Reachability Verification

Confirm the number can receive communications:

  • HLR lookup — Check if SIM is active (wireless)
  • Line status — In service vs. disconnected
  • Roaming status — Currently reachable

Validate any number instantly. Format, carrier, and line type in one call.

Get Free API Key

When to Validate

At Data Entry

Validate numbers as users enter them:

  • Form submission — Real-time format check
  • Registration — Verify before sending OTP
  • CRM import — Batch validate new contacts

Before Outreach

Re-validate before campaigns:

  • SMS campaigns — Remove landlines and disconnected numbers
  • Voice campaigns — Verify numbers are still active
  • Lead follow-up — Check before sales calls

Periodic Refresh

Numbers change over time:

  • Disconnections — ~15% of numbers churn annually
  • Porting — Carriers change
  • Reassignment — Numbers get recycled

Why Line Type Matters

Different line types have different capabilities:

Line Type SMS Voice Notes
Wireless Yes Yes Best for SMS campaigns
Landline Limited Yes SMS via text-to-speech only
VoIP Varies Yes SMS support depends on provider
Toll-free Yes Yes Business numbers

Implementation Example

# Complete validation workflow
def validate_phone(phone):
    # Step 1: Format validation (free, local)
    if not is_valid_format(phone):
        return {"valid": False, "error": "Invalid format"}

    # Step 2: Carrier/validity lookup (API call)
    result = veriroute_lookup(phone, lrn=True)

    if not result.get('lrn'):
        return {"valid": False, "error": "Number not found"}

    # Step 3: Check line type for SMS capability
    line_type = result['lrn'].get('line_type')
    sms_capable = line_type in ['wireless', 'voip']

    return {
        "valid": True,
        "carrier": result['lrn']['carrier'],
        "line_type": line_type,
        "sms_capable": sms_capable,
        "ported": result['lrn'].get('ported', False)
    }

Best Practices

  1. Validate early — Catch bad numbers at entry
  2. Check line type — Filter landlines from SMS lists
  3. Use standardized format — Store in E.164 (+15551234567)
  4. Re-validate periodically — Numbers change over time
  5. Batch validate imports — Clean lists before adding to CRM
  6. Handle edge cases — Toll-free, short codes, international

Frequently Asked Questions

What's the difference between format validation and carrier lookup?

Format validation checks if a number follows correct patterns (right length, valid area code). Carrier lookup verifies the number actually exists in carrier databases and can identify the serving carrier, line type, and porting status. Format validation is free and local; carrier lookup requires an API call.

How often should I re-validate phone numbers?

For active contacts, re-validate every 6-12 months. For dormant contacts or before large campaigns, validate immediately before use. About 15% of phone numbers change status (disconnect, port, reassign) each year.

Should I validate phone numbers in real-time during form submission?

Yes, real-time validation during form submission catches errors immediately and improves data quality. Use format validation first (instant, free), then carrier lookup for important flows like registration or payment. The ~200ms latency is acceptable for most user experiences.

Related Articles

← Back to Phone Number Intelligence

Improve Your Data Quality

Validate phone numbers with format, carrier, and line type checks.