# Phone Number Validator - Bulk E.164 Formatter (Offline) (`kotablue-tools/phone-number-validator`) Actor

Validate and format up to 10,000 phone numbers per run offline with Google's libphonenumber data: valid/invalid with a reason, E.164, international, national and tel: formats, country, number type (mobile, fixed line, toll-free...). No API key.

- **URL**: https://apify.com/kotablue-tools/phone-number-validator.md
- **Developed by:** [KotaBlue Toolsmith](https://apify.com/kotablue-tools) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Phone Number Validator: Bulk E.164 Formatter & Number Type Checker (Offline)

**Paste a list of phone numbers in any format and validate them all in one run. Each line gets one spreadsheet-ready row: VALID, INVALID or REPEAT, a plain-English reason, the number in E.164, international, national and `tel:` (RFC 3966) format, country, calling code, extension and number type (mobile, fixed line, toll-free, VoIP and more).**

Up to 10,000 lines per run, checked offline with Google's libphonenumber numbering-plan data: no API key, no login, no proxy, and your numbers are not sent to any outside service. Built for cleaning CRM and lead lists, normalising form data to E.164 before an SMS or calling tool, and removing duplicates written in different formats.

### What does this phone number validator do?

- **Validates against each country's numbering plan.** Uses Google's libphonenumber rules for 245 countries and territories: number length, and whether the digits fall in an allocated range.
- **Formats to E.164 and more.** Returns `+12133734253` (E.164, the format SMS, telephony and CRM APIs expect), `+1 213 373 4253` (international), `(213) 373-4253` (national) and `tel:+12133734253` (RFC 3966 link).
- **Detects the number type.** `MOBILE`, `FIXED_LINE`, `FIXED_LINE_OR_MOBILE`, `TOLL_FREE`, `PREMIUM_RATE`, `SHARED_COST`, `VOIP`, `PERSONAL_NUMBER`, `PAGER`, `UAN` or `VOICEMAIL`, plus a simple `canBeMobile` flag for SMS-list filtering.
- **Reads messy input.** Spaces, brackets, dots, dashes, a `Tel:` label, a `00` prefix and extensions (`ext. 12`, `x12`) are handled.
- **Works with national numbers.** Numbers without a `+` country code are read with a **Default country** (US unless you change it) or with a country code on the same line, such as `020 7946 0958, GB`.
- **Flags the wrong country.** When a number carries its own `+` code that differs from the expected country, `countryMatchesExpected` is false and the message says so.
- **Finds duplicates across formats.** `(213) 373-4253` and `+1 213 373 4253` are the same number; the second one comes back as `REPEAT`.
- **One clear status per line.** `VALID`, `INVALID` with a reason code such as `TOO_SHORT` or `NOT_IN_NUMBERING_PLAN`, or `REPEAT`. Rows keep your input order.

### Who is this for?

- **Sales and marketing teams.** Clean lead lists and CRM exports before importing them into a dialer, SMS platform or ad audience, and drop numbers that can't be dialled.
- **SMS and messaging senders.** Normalise numbers to E.164 and use `canBeMobile` to keep likely mobile numbers before a campaign (see the note on US and Canadian numbers below).
- **CRM, data quality and migration teams.** Standardise phone columns in Salesforce, HubSpot or spreadsheet exports to one format and remove duplicates.
- **Developers, e-commerce and logistics.** Validate phone fields from sign-up, checkout or delivery forms in bulk from the Apify API.
- **Spreadsheet users.** Paste a column from Excel or Google Sheets and export the results back as CSV or Excel.

### How to use it

1. Open the Actor and paste numbers into **Phone numbers to validate**, one per line. Any common format works.
2. Set **Default country** to the country most of your numbers without `+` belong to (two-letter ISO code such as US, GB, DE or IN). Leave it empty to require a `+` country code.
3. For lines from another country, add the country code after a comma, semicolon, `|` or tab, for example `020 7946 0958, GB`.
4. Click **Start**, then open the **Output** tab and filter on `status`, `reason` or `numberType`.
5. Export as CSV, Excel or JSON, or call the Actor from the Apify API, Make, Zapier or n8n.

### Input

| Field | Description |
|---|---|
| `phoneNumbers` | One phone number per line, optionally followed by `, CC` (a two-letter country code after a comma, semicolon, `|` or tab). Max 10,000 lines per run. |
| `defaultCountry` | Two-letter ISO country code used for numbers without a `+` country code and without a country on their line. Default **US**. Leave empty to require `+`. |

Example input (well-known example and fictional numbers, a repeat in another format, one extension, one short number and one unallocated area code):

```json
{
  "phoneNumbers": [
    "+1 213 373 4253",
    "(213) 373-4253",
    "020 7946 0958, GB",
    "+33 6 12 34 56 78",
    "0049 30 123456",
    "Tel: +61 4 1234 5678",
    "+1 800 555 0199",
    "+1 213 373 4253 ext. 12",
    "555-0100",
    "+1 999 373 4253"
  ],
  "defaultCountry": "US"
}
```

### Output

Each input line gives one dataset row. Fields:

`input, inputIndex, status, reason, firstStatus, message, e164, international, national, rfc3966, countryCode, countryName, callingCode, nationalNumber, extension, numberType, canBeMobile, isPossible, isValid, countrySource, expectedCountry, countryMatchesExpected, internationalPrefixConverted, extractedFromText, validatedAt`

Below are real rows from a cloud run on Nov 4, 2026 with the example input above. Empty and false fields and timestamps are left out.

A valid US number written in international format:

```json
{
  "input": "+1 213 373 4253",
  "inputIndex": 1,
  "status": "VALID",
  "message": "Valid United States number (fixed line or mobile) per Google's libphonenumber numbering-plan data. A valid number is not proof that it is in service or reachable. This country's numbering plan does not separate mobile and landline numbers.",
  "e164": "+12133734253",
  "international": "+1 213 373 4253",
  "national": "(213) 373-4253",
  "rfc3966": "tel:+12133734253",
  "countryCode": "US",
  "countryName": "United States",
  "callingCode": "+1",
  "nationalNumber": "2133734253",
  "numberType": "FIXED_LINE_OR_MOBILE",
  "canBeMobile": true,
  "isPossible": true,
  "isValid": true,
  "countrySource": "NUMBER",
  "expectedCountry": "US",
  "countryMatchesExpected": true
}
```

A UK national number with the country given on its line (shortened to the key fields):

```json
{
  "input": "020 7946 0958, GB",
  "inputIndex": 3,
  "status": "VALID",
  "e164": "+442079460958",
  "international": "+44 20 7946 0958",
  "national": "020 7946 0958",
  "countryCode": "GB",
  "countryName": "United Kingdom",
  "numberType": "FIXED_LINE",
  "countrySource": "LINE_COUNTRY",
  "expectedCountry": "GB"
}
```

A number that is too short for the default country:

```json
{
  "input": "555-0100",
  "inputIndex": 9,
  "status": "INVALID",
  "reason": "TOO_SHORT",
  "message": "The number has too few digits for its country. It was read as a United States number because it has no + country code; if it belongs to another country, add +<code> or a country code after a comma.",
  "countryCode": "US",
  "countryName": "United States",
  "callingCode": "+1",
  "nationalNumber": "5550100",
  "countrySource": "DEFAULT_COUNTRY",
  "expectedCountry": "US"
}
```

In the same run, `(213) 373-4253` came back `REPEAT` of input #1 (same E.164 `+12133734253`); `+33 6 12 34 56 78` was a `MOBILE` number in France with `countryMatchesExpected` false (default country US); `0049 30 123456` was read as `+4930123456` (Germany, `FIXED_LINE`) with `internationalPrefixConverted` true; `Tel: +61 4 1234 5678` became `+61412345678` (`MOBILE`, national `0412 345 678`); `+1 800 555 0199` was `TOLL_FREE`; the extension line kept `extension` `12` and `rfc3966` `tel:+12133734253;ext=12`; and `+1 999 373 4253` was `INVALID` with reason `NOT_IN_NUMBERING_PLAN` (area code 999 is not in use in the North American plan). Run totals: 7 VALID, 2 INVALID, 1 REPEAT.

Possible `status` values:

- **VALID**: the number has a possible length and its digits are in an allocated number range for its country.
- **INVALID**: the number could not be read or failed a check; `reason` says which. Formatted fields (`e164`, `international`, `national`, `rfc3966`) are left empty on INVALID rows so a bad number never looks clean in an import.
- **REPEAT**: the same number (and extension) appeared earlier in the run, in any format; `firstStatus` shows the first result.

Possible `reason` values: `EMPTY`, `INPUT_TOO_LONG`, `UNKNOWN_COUNTRY_CODE` (the code after the comma isn't a supported country), `NOT_A_NUMBER`, `NO_COUNTRY` (no `+` code and no country given), `UNKNOWN_CALLING_CODE`, `TOO_SHORT`, `TOO_LONG`, `INVALID_LENGTH`, `NOT_IN_NUMBERING_PLAN`.

`countrySource` says where the country came from: `NUMBER` (its own `+` or `00` code), `LINE_COUNTRY` (the code after the comma) or `DEFAULT_COUNTRY`. A run summary (counts per status, reason, number type and country, plus the settings used) is saved as `OUTPUT` in the key-value store.

### What a VALID result does and does not mean

A VALID number is **well-formed**: it has a length used in its country and sits in a number range that the national numbering plan allocates. It does **not** prove that the number is in service, belongs to the person you expect, or can receive SMS or WhatsApp messages. The Actor makes no carrier or HLR lookup, so it cannot see disconnected or ported numbers. `numberType` describes the range a number was allocated from; a number ported to another network keeps the type of its original range.

**US, Canada and other +1 countries:** the North American numbering plan does not separate mobile and landline ranges, so most +1 numbers come back as `FIXED_LINE_OR_MOBILE` with `canBeMobile` true. To tell US mobiles from landlines you need a carrier lookup service, which this Actor does not do.

### Pricing

- **This Actor is currently free to use.** There is no Actor fee; runs use your normal Apify platform credits for compute.

### Limits and performance

- Up to 10,000 lines per run. Extra lines are skipped with a warning in the log.
- All checks run locally with no network request per number, so results don't depend on any outside API being up and there are no rate limits.
- Default memory is 128 MB. A local test with 10,000 numbers finished in under 3 seconds with the JavaScript heap capped at 40 MB.
- If a line contains a number inside other text (for example `Call +44 20 7946 0958 now`), the number is extracted and `extractedFromText` is true, so you can review those lines.
- Numbering-plan data is the version bundled with libphonenumber-js 1.13.15 at build time. Countries change their plans now and then; the Actor is rebuilt to pick up updates.

### FAQ

**What is E.164 and why should I store numbers that way?**
E.164 is the international standard format: a `+`, the country calling code and the national number, with no spaces (for example `+442079460958`). Most SMS, calling and CRM APIs expect it, and it makes duplicates easy to spot.

**Can it tell me if a number is a mobile?**
For most countries, yes: `numberType` is `MOBILE` when the number is in a mobile range. In the US, Canada and other +1 countries mobile and landline ranges are mixed, so those numbers come back as `FIXED_LINE_OR_MOBILE`.

**Does it check whether the number is active or on WhatsApp?**
No. It is an offline format and numbering-plan check. It does not call, text or query any carrier, WhatsApp or other service.

**What happens with the leading 00?**
If a number starts with `00` and isn't valid as written, the Actor tries it again as `+` (the international prefix used in most of Europe and elsewhere). If that gives a valid number, `internationalPrefixConverted` is true.

**Is my data sent anywhere?**
No outside service is called. Your input and results stay in your Apify run storage.

**Which export formats are supported? Can I use the API?**
CSV, Excel, JSON, JSONL, XML and HTML. You can also start runs from the Apify API, schedule them, or connect them to Make, Zapier, n8n or webhooks.

### Related tools

Other free data tools from the same publisher:

- [IBAN Validator](https://apify.com/kotablue-tools/iban-validator): bulk IBAN checksum, country format and bank code check, offline.
- [OFAC SDN Sanctions Screening](https://apify.com/kotablue-tools/ofac-sdn-sanctions-screening): screen names against the OFAC SDN list with fuzzy match scores.
- [LEI Lookup & LEI Renewal Checker (GLEIF)](https://apify.com/kotablue-tools/gleif-lei-renewal-checker): bulk LEI status and lapsed-LEI flags.
- [ISIN / CUSIP / Ticker to FIGI + LEI Mapper](https://apify.com/kotablue-tools/figi-lei-identifier-mapper): map security identifiers to FIGI and the issuer's LEI.
- [SEC EDGAR Company Lookup](https://apify.com/kotablue-tools/sec-edgar-company-lookup): ticker or CIK to company details and latest filings.
- [Bulk VIN Decoder & Recall Checker (NHTSA)](https://apify.com/kotablue-tools/nhtsa-vin-decoder): decode VINs to make, model and year, with recalls.
- [ClinicalTrials.gov NCT Lookup](https://apify.com/kotablue-tools/clinicaltrials-study-status-checker): bulk trial status and a results-due estimate.

### Method, sources and licences

Parsing, formatting, validation and number types use the open-source **libphonenumber-js** library (version 1.13.15, MIT licence, © 2016 @catamphetamine, https://gitlab.com/catamphetamine/libphonenumber-js) with its full ("max") metadata. That metadata is generated from Google's **libphonenumber** `PhoneNumberMetadata.xml` (© Google, Apache License 2.0, https://github.com/google/libphonenumber). Country names come from the Unicode CLDR data built into Node.js. Example numbers in this README are libphonenumber's documentation example, fictional ranges (UK 020 7946 0xxx is reserved for drama, US 555-01xx is fictional) or generic samples.

This Actor is **independent and is not affiliated with, endorsed by, or approved by Google, the ITU, any national numbering authority or any telephone carrier**. All statuses, reasons and messages are computed by this Actor. It is a data-quality tool, not a phone verification, carrier lookup, fraud or compliance (for example TCPA or do-not-call) service, and results are provided as-is without warranty.

# Actor input Schema

## `phoneNumbers` (type: `array`):

One phone number per line, in any common format: +44 20 7946 0958, (213) 373-4253, 0044 20 7946 0958, +1 213 373 4253 ext. 12. Numbers without a + country code are read with the Default country below, or with a two-letter country code after a comma, semicolon, | or tab on the same line (for example 020 7946 0958, GB). A number repeated in the same run is returned as REPEAT. Max 10,000 lines per run.

## `defaultCountry` (type: `string`):

Two-letter ISO country code (for example US, GB, DE, IN) used for numbers written without a + country code and without a country on their line. Leave empty to require a + country code or a per-line country.

## Actor input object example

```json
{
  "phoneNumbers": [
    "+1 213 373 4253",
    "020 7946 0958, GB",
    "+33 6 12 34 56 78",
    "555-0100"
  ],
  "defaultCountry": "US"
}
```

# Actor output Schema

## `results` (type: `string`):

One row per input line with status (VALID, INVALID, REPEAT), reason, E.164, international, national and tel: formats, country, calling code, number type and mobile flag.

## `summary` (type: `string`):

Counts per status, invalid reason, number type and country, and the settings used.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "phoneNumbers": [
        "+1 213 373 4253",
        "020 7946 0958, GB",
        "+33 6 12 34 56 78",
        "555-0100"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kotablue-tools/phone-number-validator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "phoneNumbers": [
        "+1 213 373 4253",
        "020 7946 0958, GB",
        "+33 6 12 34 56 78",
        "555-0100",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("kotablue-tools/phone-number-validator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "phoneNumbers": [
    "+1 213 373 4253",
    "020 7946 0958, GB",
    "+33 6 12 34 56 78",
    "555-0100"
  ]
}' |
apify call kotablue-tools/phone-number-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kotablue-tools/phone-number-validator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/9vFNSd24hGHdwZSPJ/builds/hLCrZQUMqhCspRlcb/openapi.json
