# Phone

Generates a random telephone number that matches the country or region of the input telephone number, but preserves the format. For example, (123) 456-7890 or 123-456-7890.

If the input is not a valid telephone number, the generator randomly replaces numeric characters. You can also replace invalid numbers with valid numbers.

By default, the numbers are United States telephone numbers.

If the input is a valid telephone number, or if you replace invalid numbers, then the generated numbers pass Google's [`libphonenumber`](https://github.com/google/libphonenumber) verification.

## Characteristics <a href="#phone-characteristics" id="phone-characteristics"></a>

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Consistency</strong></td><td valign="top">Yes, can be made self-consistent.</td></tr><tr><td valign="top"><strong>Linking</strong></td><td valign="top">No, cannot be linked.</td></tr><tr><td valign="top"><strong>Differential privacy</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Data-free</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Allowed for primary keys</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Allowed for unique columns</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Uses format-preserving encryption (FPE)</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Privacy ranking</strong></td><td valign="top">3</td></tr><tr><td valign="top"><strong>Generator ID (for the API)</strong></td><td valign="top"><a href="/pages/EFPhZCzc60GKwBShPl0P"><code>USPhoneNumberGenerator</code></a></td></tr></tbody></table>

## How to configure <a href="#phone-configure" id="phone-configure"></a>

To configure the generator:

1. Toggle the **Replace invalid numbers** setting to indicate whether to replace invalid input values with a valid output value.\
   \
   By default, the generator does not replace invalid values. It randomly replaces numeric characters.
2. Toggle the **Consistency** setting to indicate whether to make the generator self-consistent.\
   \
   By default, consistency is disabled.
3. When consistency is enabled, to have Structural ignore formatting when it determines whether two values are the same, toggle **Ignore formatting** to the on position.\
   \
   For example, the source data includes original values of `1.234.567.8901` and `1 (234) 567 8901`. These are the same number, but with different formats.\
   \
   When **Ignore formatting** is off, then in the output, these values are replaced with different values.\
   \
   When **Ignore formatting** is on, then these values are replaced with the same number, with the original format preserved. For example, `1.234.567.8901` becomes `1.987.765.4321`, and `1 (234) 567 8901` becomes `1 (987) 765 4321`.
4. If [Structural data encryption](/app/generation/generators-assign-config/generators-data-encryption-config.md) is enabled, then to use it for this column, in the advanced options section, toggle **Use data encryption process** to the on position.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonic.ai/app/generation/generators/generator-reference/phone.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
