# Redact phone numbers

> Redact phone numbers in national and international formats from text, JSON, and CSV. Model-gated, so dates and ID numbers are not mistaken for numbers.

Canonical: https://bitbanger.in/entities/phone
Last updated: 2026-10-27

Category: Contact details · Entity type: `contact.phone`

Phone numbers are hard to detect by regex alone: the same digit shapes appear in dates, order IDs, and account numbers. Redactly uses a model gate first and only then expands the match to the full number.

## How Redactly detects phone numbers

- Reported when the model flags the value, or when a number follows a phone cue such as tel, mobile, or call; the regex layer then snaps the span to the complete number.
- Handles country codes, parentheses, and space, dot, or hyphen separators.
- Date-shaped and ID-shaped digit strings that the model does not flag are left alone.

## Why redact phone numbers?

Phone numbers are a primary target for SIM-swap and smishing attacks against your customers.

## Example request

```bash
curl -X POST https://api.bitbanger.in/v1/redact \
  -H "X-API-Key: rdct_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "Phone: +1 202-555-0143, best reached after 6pm.", "style": "replace"}'
```

## FAQ

**Does Redactly redact phone numbers automatically?**

Yes. Send text to the API and every detected type is redacted, including phone numbers. To redact only this type, pass the value contact.phone in the entities filter. No training or configuration is required.

**What happens to phone numbers after redaction?**

With style set to replace, each match becomes [contact.phone] — the entity type in square brackets. Setting style to mask replaces every character with a block character, and remove deletes the span entirely.

## Related entity types

- [Email addresses](https://bitbanger.in/entities/email) — Redact email addresses from text, JSON, and CSV with one HTTP call. Returns exact character offsets and keeps your structure intact.
- [Street addresses](https://bitbanger.in/entities/address) — Redact postal addresses from free text and structured payloads, including partial street names the model only half-captures.
- [Postal codes](https://bitbanger.in/entities/postal-code) — Redact ZIP and postcode values in US 5-digit, ZIP+4, and UK formats from text and tabular data.

Try it on your own text: https://bitbanger.in/entities/phone
