phone.number

Generates random phone numbers with support for different formatting styles. Phone numbers use valid area codes (200-999) and exchange codes (200-999) to avoid special service numbers.

Keywords

styleoptional

Controls the formatting of the generated phone number. Must be one of: us, e164, or plain. Defaults to us if not specified.

  • us - US format with parentheses and hyphens: (555) 123-4567
  • e164 - International E.164 format with country code: +15551234567
  • plain - Plain digits with no formatting: 5551234567

Behavior

Generated phone numbers:

  • Use area codes in the range 200-999 (avoiding reserved codes)
  • Use exchange codes in the range 200-999 (avoiding N11 service codes)
  • Use subscriber numbers in the range 0000-9999
  • Are valid US phone number formats
  • Are not guaranteed to be unique
  • Are deterministic based on the simulation seed

Examples

Default US formatting:

{
  "type": "phone.number"
}

Example outputs:

  • (555) 123-4567
  • (234) 567-8901
  • (789) 012-3456

E.164 international format:

{
  "type": "phone.number",
  "style": "e164"
}

Example outputs:

  • +15551234567
  • +12345678901
  • +17890123456

Plain digit format (useful for database storage):

{
  "type": "phone.number",
  "style": "plain"
}

Example outputs:

  • 5551234567
  • 2345678901
  • 7890123456