Random Phone Number Generator

Test phone numbers from the blocks Ofcom and the North American plan reserve for fiction, so the numbers in your test data cannot ring a real person.

Enable JavaScript to customise; default output below.

The first six are reserved for fiction by a regulator. The rest are listed to explain that those countries have no reserved range, so a realistic number there belongs to somebody.

Format

National for a screenshot, E.164 for a database column.

Live preview test-phone-numbers.txt
generated in your browser

Range                                  UK mobile, 07700 900xxx
How many                               10

The range
  which one                            UK mobile, 07700 900xxx
  reserved by                          Ofcom reserves 07700 900000 to 900999 for drama and documentation
  country                              United Kingdom, +44
  can it ring anybody                  no, that is the point of a reserved range

Every range this offers
  UK mobile, 07700 900xxx              yours
  London, 020 7946 0xxx
  UK, no real area code, 01632 960xxx
  UK freephone, 0808 157 0xxx
  United States, 555-01xx
  Canada, 555-01xx

These come from a block a regulator has set aside: Ofcom reserves 07700
900000 to 900999 for drama and documentation. A generator that produces
plausible-looking numbers instead produces numbers that belong to real
people, and those end up in test databases, screenshots and published
documentation, and eventually somebody's phone rings.

Ofcom publishes ranges for drama and documentation, which is why British
television uses 020 7946 0000 numbers and 07700 900000 mobiles. They are
never assigned to a subscriber, so they cannot be dialled into a real
conversation.

The North American plan reserves 555-0100 to 555-0199 in every area
code. The rest of the 555 range is not reserved and parts of it are
assigned, so "any 555 number" is not safe: only 0100 to 0199.

Most countries have no reserved range at all. Germany, France, India,
Italy, Spain, Brazil and Japan have published none, so a
realistic-looking number for those is a real number belonging to
somebody. For test data in those markets, a UK or North American
reserved number is the safer choice, however out of place it looks.

A reserved number is still personal-data-shaped. Anything that looks
like a phone number in a test database gets treated as one by the next
system it meets, so a reserved range protects the stranger who would
otherwise be called, not your data-protection obligations.

These numbers are for testing formats and validation, not for testing
delivery. Nothing will ever be delivered to them, which is exactly why
they are safe and also why they cannot verify that an SMS gateway works.

If you need a number that can actually receive a message during testing,
use one you own, or a test number your gateway provides for the purpose.
Every provider has one, and it is documented alongside their test card
numbers.

Output is valid and updates as you type.

Most random phone number generators produce numbers that look real. That is the problem: a number that looks real usually is real, and it belongs to somebody. Those numbers end up in test databases, in screenshots, in published documentation, and occasionally in a live campaign, and then a stranger’s phone rings.

Two regulators have set blocks aside so that does not have to happen. Ofcom reserves ranges for drama and documentation, which is why British television uses 020 7946 0000 numbers. The North American plan reserves 555-0100 to 555-0199 in every area code.

Every number here comes from one of those blocks. Nothing else is offered, and the countries with no reserved range are listed so that choosing one explains the problem instead of producing a number that belongs to a person.

How to use

  1. Pick a reserved range.
  2. Choose how many and the format: national for a screenshot, E.164 for a database column.
  3. Paste them into your fixtures.

Example

07700 900496
07700 900566
07700 900149
07700 900565

Numbers                                4, all different

The range
  which one                            UK mobile, 07700 900xxx
  reserved by                          Ofcom reserves 07700 900000 to 900999 for drama and documentation
  country                              United Kingdom, +44
  can it ring anybody                  no, that is the point of a reserved range

In E.164, from the North American block:

+12125550149
+19175550163
+14155550173

Pitfalls

Not every 555 number is safe. Only 555-0100 to 555-0199 is reserved. The rest of the 555 range is assignable and parts of it are assigned, so “any 555 number” is not a rule, and the film convention is older than the reservation.

Most countries have no reserved range at all. Germany, France, Italy, Spain, the Netherlands, India, Bangladesh, Brazil and Japan have published none. A realistic-looking number for those markets belongs to somebody, so for test data the safer choice is a UK or North American reserved number, however out of place it looks, or a number you control.

Australia reserves specific numbers rather than a block. That list is short, easy to misremember and easy to get wrong from memory, so it is not offered here rather than offered inaccurately.

A reserved number is still shaped like personal data. Anything that looks like a phone number gets treated as one by the next system it meets. The reservation protects the stranger who would have been called; it does not change your obligations about the rest of the record.

They cannot test delivery. Nothing will ever arrive at these numbers, which is what makes them safe and also means they cannot verify that an SMS gateway works. For that, use a number you own or the test number your gateway documents.

Do not use a colleague’s number as test data. It is the other common shortcut, and it works until the test data reaches a campaign or a load test.

Check the format your system stores. These come out in national format by default, which is for reading. Store E.164, which is the option here and is what the phone formatter on this site is about.

Compatibility

Everything runs in the browser: nothing is uploaded and nothing is stored.

Randomness comes from crypto.getRandomValues through the same unbiased integer routine the other random tools here use, so the numbers are drawn evenly across the block rather than clustering at the low end the way a modulo would. Duplicates are removed, so a request for 500 numbers from a 1,000-number block returns 500 different ones.

The generated numbers are run through the same parser the phone formatter uses, and the test suite asserts that every range parses cleanly and that four hundred draws from each block stay inside it.

The UK blocks are Ofcom’s published drama ranges: 07700 900000–900999, 020 7946 0000–0999, 01632 960000–960999 where 01632 is not a real area code at all, and 0808 157 0000–0999 for freephone. The North American range is 555-0100–555-0199, combined here with real, assigned area codes, since it is the subscriber range that is reserved.

Frequently asked questions

Can these numbers receive a call or a text?
No. They are not assigned to anybody and never will be, which is the entire point.
Why not just make up a number?
Because made-up numbers are real numbers. Dialling codes are dense, and a plausible number in a real range is almost certainly somebody’s.
What do I use for a German or Indian test number?
There is no safe reserved range in those countries. Use a UK or North American reserved number, or a number your organisation owns. Some documentation uses a real area code with an obviously invalid subscriber part, which is a convention rather than a guarantee.
Are these valid for a phone-number validation library?
Yes, and that is a useful property: they are correctly formatted, they pass a syntax check, and libphonenumber recognises them. A library that rejects them is rejecting valid numbers.
What about test credit card numbers?
Same idea, different publisher: payment providers publish test card numbers that are Luhn-valid and cannot be charged. Use theirs rather than generating your own.
Weekly drops

New tools, when there are new tools

One email when something worth using ships. No schedule to fill, so no filler.

Your address goes nowhere else, and one click unsubscribes.