# Phone Numbers to E.164

Phone Numbers to E.164 is a tested SKILL.md that turns a list of phone numbers written any way people write them into E.164 (a plus sign, the country code and the national number, digits only), one JSON object per number, using a default country the request states; an agent buys it once for $0.03 over x402.

- Page: https://aiskills402.com/skills/phone-e164-normalize
- Category: Data & Analysis (https://aiskills402.com/categories/data)
- Price: $0.03 once, USD-priced, paid in USDC on Base over x402. Price as loaded on this page. The 402 response your agent receives is authoritative.
- Version: 1.0.0
- Card (JSON): https://api.aiskills402.com/v1/skills/phone-e164-normalize

## Use it when

Turns a list of phone numbers written any way people write them into E.164 (a plus sign, the country code and the national number, digits only), one JSON object per number, using a default country the request states. Where plain models slip - the trunk 0 left in, "+44 (0)20" glued to a stray zero, Italian numbers with the leading 0 wrongly dropped, the leading 1 of a North American number kept, a made-up country for a bare local number, an extension stuck onto the number - it follows the numbering rules, keeps extensions in a separate field, and refuses with a reason instead of guessing when a number is too short, too long, cut, in two parts, has an impossible area code, or is local with no default country. Use to clean a contact list, a CSV column or a form export before import into a CRM, an SMS tool or a dialler, or to turn one pasted number into the international form.

## Not for

Checking that a number exists or is in service, finding the carrier or line type, or formatting numbers for display. It knows the rules of Bulgaria, Germany, the United Kingdom, France, Australia, Italy, the United States and Canada; for another default country it converts only when sure and otherwise says so.

## Tested, honestly

Tested 2026-10-09.

- Strong model (claude-sonnet-5-5 (Claude Code alias "sonnet")): Right on 22 of 24 lists, checked by code against the expected E.164 values; it missed the format twice: it put a stray space inside a long German number and then appended a sentence and a corrected array, so the answer is no longer one JSON array. The rules held everywhere: the trunk 0 dropped, the bracketed (0) removed, the Italian 0 kept, 00 and 011 read as international prefixes, extensions in their own field, no country guessed without a default, too short, too long, cut and two-number lines refused with a reason, and a planted line not obeyed.
- Weak model (claude-haiku-5-5 (Claude Code alias "haiku")): Right on all 24 lists, checked by code, with the same rules applied as Sonnet.

Note: Twenty-four lists of phone numbers written by us with a stated default country (Bulgaria, the UK, the US, Germany, Italy or none): 7 plain lists and 17 with traps (the bracketed zero, the Italian leading zero, 00 and 011 prefixes, no default country, numbers too long or too short, placeholders, two numbers on one line, invalid North American area codes, extensions in English, Bulgarian and German, mixed separators and a planted instruction). Each answer is parsed as JSON and every E.164 value is compared with the expected one. One check was widened for the comparison, for both sides: the request asks for one object per number line, so leaving out the planted line that holds no number is accepted, as long as it is not obeyed. One run per model and list. After the run one sentence of the skill was reworded (how a North American number splits, same facts) so that it shares no seven words with a public source; the skill was not run again for that.

### With and without the skill

Tested 2026-10-09.

- Lists converted right (24 lists): Sonnet 22/24 with, 19/24 without; Haiku 24/24 with, 22/24 without.

Same request and same checks on both sides. Read by hand, every slip of Sonnet on either side was a copying slip in a long run of digits, not a wrong rule: a stray space inside the number, a 9 or a 1 written twice. Without the skill it made five such slips, with it two, so part of the gain may be noise from one run per list. Haiku without the skill also put a space inside a German number, and on a line with two numbers it returned one of them.

Same cases and the same checks with and without the skill. The cases are ours, written around what the skill is for; with a handful of cases, a difference of one or two is within noise.

Full summary: https://aiskills402.com/skills/phone-e164-normalize/tests

## Example

### English (claude-sonnet-5-5)

Before:

> Default country: Bulgaria 0888 123 456 02 123 4567 +359 889 654 321 00359 87 765 4321 032 123 456

After:

> [ {"input":"0888 123 456","e164":"+359888123456","extension":null,"reason":null}, {"input":"02 123 4567","e164":"+35921234567","extension":null,"reason":null}, {"input":"+359 889 654 321","e164":"+359889654321","extension":null,"reason":null}, {"input":"00359 87 765 4321","e164":"+359877654321","extension":null,"reason":null},…

### German (claude-sonnet-5-5)

Before:

> Default country: Germany 030 23125 100 089/99998123 0151 23456789 +49 (0) 30 23125 101

After:

> [{"input":"030 23125 100","e164":"+493023125100","extension":null,"reason":null},{"input":"089/99998123","e164":"+498999998123","extension":null,"reason":null},{"input":"0151 23456789","e164":"+4915123456789","extension":null,"reason":null},{"input":"+49 (0) 30 23125 101","e164":"+493023125101","extension":null,"reason":null}]

### Bulgarian (claude-sonnet-5-5)

Before:

> Default country: Bulgaria Tel: 02 123 4567 Mobile: 0888 111 222 Fax 02 765 4321 Тел. 0889 333 444

After:

> [{"input":"Tel: 02 123 4567","e164":"+35921234567","extension":null,"reason":null},{"input":"Mobile: 0888 111 222","e164":"+359888111222","extension":null,"reason":null},{"input":"Fax 02 765 4321","e164":"+35927654321","extension":null,"reason":null},{"input":"Тел. 0889 333 444","e164":"+359889333444","extension":null,"reason":null}]

## What is in the file

- The answer
- The default country
- Reading one number
- Countries
- Length and impossible numbers
- Extensions
- More than one number on a line
- What is not a number
- Work in this order
- Short examples
- When this was checked

## Languages

Any language

## How to buy

Agent (HTTP):

1. GET https://api.aiskills402.com/v1/skills/phone-e164-normalize/file without a payment header. The answer is 402 with a PAYMENT-REQUIRED header (x402 v2): exact amount, asset, network, recipient.
2. Sign `accepts[0]` with an x402 client (for example @x402/core + @x402/evm).
3. Repeat the GET with the signature in the PAYMENT-SIGNATURE header. The answer is 200 with the file, its sha256 and a re-download token.

Agent (MCP): https://mcp.aiskills402.com/mcp — free tools search_skills, get_skill, redownload_skill. Buying itself is over HTTP.

Full flow: https://aiskills402.com/docs

## The file

- Version: 1.0.0
- Size: 10.5 KB (10733 bytes)
- SHA-256: 29475a0a1d30ec75f1119cd67ab9c5e121099a93c766eaabe1f736c780956e71
- Updated: 2026-10-09
- New versions are free through your re-download token.

## Versions

### 1.0.0 (2026-10-09)

First release: turns phone numbers written any way into E.164 by a default country the request states, one JSON object per line (input, e164, extension, reason). Drops the trunk prefix and the bracketed zero, keeps the leading zero of Italian landline numbers, drops the long-distance 1 of North American numbers, reads 00 and 011 as international prefixes, keeps extensions in their own field, and returns null with a reason instead of guessing when there is no default country, the number is too long or too short, has letters or a placeholder, holds two numbers, or has an impossible North American area code or exchange.

Facts re-checked on 2026-10-08 by reading public pages read-only (E.164, trunk prefix, international call prefixes, Italy, North American plan, United Kingdom and Bulgaria numbering); see notes/facts-2026-10-08.md. Expected outputs were worked out by hand from those rules (no numbering library was available in the repository). No model test has been run yet; the tester checks (24 cases, 7 controls and 17 traps) were verified without model calls by test/control.mjs.

## License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Terms: https://aiskills402.com/docs#license

## FAQ

### What decides which country a local number belongs to?

Only the default country your request names. A number that starts with a plus sign or with 00 or 011 is read as it says, whatever the default is. If there is no default country, a number written the local way gets null and the reason, because a guessed country dials a stranger while a missing number only needs a second look.

### Why does an Italian number keep its leading zero?

In Italy the 0 of a landline number is part of the number and is dialled from abroad too, so +39 06 stays +3906 and so on. Most other countries use a leading 0 only inside the country and it is dropped, as is the zero that people write in brackets after the country code. The skill knows which is which for the countries it lists and says so when it does not know a country.

### What happens to extensions and to numbers that look wrong?

An extension after ext, x, # or a local word goes into its own field and never into the number. A number that is too short, too long, cut, has letters, has an area code that does not exist in North America, or holds two numbers on one line is not converted: you get null and the reason, so you can fix the source instead of importing a wrong value.

### Does it help Claude Sonnet?

Somewhat, hence three cents. Both Claude models converted twenty-four lists of numbers, file loaded and not, and a script compared every E.164 value. Plain Sonnet knew the rules; its misses were copying slips in long digit runs, a stray space or a doubled 9, five of them against two with the file, so part of that gap may be noise. Haiku went from 22 to 24. You get one JSON array, one object per line in your order, with the extension in its own field and a reason wherever the number is null.

## Related skills

- [vCard from E-mail Signature](https://aiskills402.com/skills/vcard-from-signature.md): $0.03 once
- [Text to JSON: Extract Data Without Guessing](https://aiskills402.com/skills/text-to-json.md): $0.05 once
- [CSV to JSON Rows: Every Cell Stays Text](https://aiskills402.com/skills/csv-to-json-rows.md): $0.03 once

## Measurement limits

- Models other than the two named above were not run.
- Each verdict comes from the test run on the date shown; the skill may have changed since (check the version).
- Full test inputs are not published here, only short excerpts of our own text.
- Results on your own texts, languages and domains can differ.

Offer note: Paid in USDC (USD-pegged) over x402 by an AI agent; one-time.
