---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/api/errors/21211#article
headline: "21211: Invalid 'To' Phone Number"
url: https://www.twilio.com/docs/api/errors/21211
inLanguage: en
dateModified: 2026-06-22T14:33:29.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# 21211: Invalid 'To' Phone Number

Log Type: APPLICATION

Log Level: ERROR

## Description

The `To` phone number in your API request is not a valid phone number or is incorrectly formatted. Twilio requires phone numbers in [E.164 format](https://en.wikipedia.org/wiki/E.164): a `+` followed by the country code and the subscriber number including the area code, with no spaces, dashes, or parentheses.

### Possible causes

* The `To` number is not in E.164 format. Common formatting mistakes include omitting the `+` prefix, omitting the country code, including spaces or punctuation, or using a local format without the country code.
* The `To` number contains a typo, extra digit, or too few digits for the destination country.
* You used the same Twilio number in both the `To` and `From` parameters. Twilio numbers cannot call or message themselves.
* You attempted to send a message to a short code or an alphanumeric sender ID. These sender types can only send messages and cannot receive them.
* You sent a message through a Messaging Service with an invalid prefix prepended to the `To` number.

### Possible solutions

* Format the `To` number in E.164: `+` followed by the country code and subscriber number with no separators. See the examples below.
* Verify you are using the correct [country calling code](https://en.wikipedia.org/wiki/List_of_country_calling_codes#Alphabetical_listing_by_country_or_region) for the destination. For example, use `+44` for the UK and `+91` for India, not `+1` (which is US/Canada).
* Check the `To` value for typos, extra digits, or missing digits. US numbers have 10 digits after the country code; UK mobile numbers have 10 digits after the country code.
* Confirm the `To` and `From` values are different. A Twilio number cannot send to itself.
* Do not set the `To` parameter to a short code or alphanumeric sender ID. These are outbound-only sender types.
* When using a Messaging Service, pass the `To` number in plain E.164 format without any channel prefix. The Messaging Service selects the appropriate sender automatically.
* If a third-party integration provides the `To` value, test the same request in the [Twilio Console SMS sandbox](https://console.twilio.com/us1/develop/sms/try-it-out/send-an-sms). If the Console request succeeds, the third party may be modifying the `To` parameter before it reaches Twilio.

### E.164 formatting examples

| Input (incorrect)   | Problem                                       | Corrected (E.164) |
| ------------------- | --------------------------------------------- | ----------------- |
| `(555) 123-4567`    | Missing `+` and country code, has punctuation | `+15551234567`    |
| `555-123-4567`      | Missing `+` and country code                  | `+15551234567`    |
| `+1 555 123 4567`   | Contains spaces                               | `+15551234567`    |
| `07911 123456`      | UK local format, missing country code         | `+447911123456`   |
| `15551234567`       | Missing `+` prefix                            | `+15551234567`    |
| `+1 (555) 123-4567` | Contains parentheses, spaces, and dashes      | `+15551234567`    |

#### Additional resources

* [What is E.164?](/docs/glossary/what-e164)
* [Twilio phone number format](/docs/phone-numbers/api/incomingphonenumber-resource)
* [Debugging tools](/docs/messaging/guides/debugging-tools)
