[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › PhoneNumberE164

```ts
const PhoneNumberE164: brand(
  "PhoneNumberE164",
  String,
  (value: string) =>
    /^\+[1-9]\d{6,14}$/u.test(value)
      ? ok()
      : err<PhoneNumberE164Error>({ type: "PhoneNumberE164", value }),
  formatPhoneNumberE164Error,
);
```

Defined in: [packages/common/src/Type.ts:9683](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/common/src/Type.ts#L9683)

International phone number in [ITU-T
E.164](https://www.itu.int/rec/T-REC-E.164) format.

PhoneNumberE164 accepts a `+` followed by 7 to 15 ASCII digits, the first of
which is not zero, such as `+14155552671`. E.164 limits numbers to 15 digits,
and no country code starts with zero. The 7-digit minimum admits the shortest
numbering plans.

The check is structural only. PhoneNumberE164 does not check country codes or
national numbering plans, which are large and changing metadata, so a valid
value is not necessarily an assigned number. It does not normalize either:
spaces, hyphens, parentheses, a `00` international prefix, and extensions are
rejected. Format user input to E.164 with a library such as libphonenumber
before validating it.

### Example

```ts
import {
  assertEqual,
  assertErr,
  assertOk,
  PhoneNumberE164,
} from "@evolu/common";

assertOk(PhoneNumberE164.fromUnknown("+14155552671"), "+14155552671");

const invalid = PhoneNumberE164.fromUnknown("+1 415 555 2671");
assertErr(invalid);
assertEqual(invalid.error, {
  type: "PhoneNumberE164",
  value: "+1 415 555 2671",
});
```