# Redact postal codes

> Redact ZIP and postcode values in US 5-digit, ZIP+4, and UK formats from text and tabular data.

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

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

Postal codes rarely identify anyone alone, but combined with a date of birth they narrow a population to a handful of people. Treat them as quasi-identifiers rather than harmless metadata.

## How Redactly detects postal codes

- Reported when the model flags the value, or when a postcode appears directly after a cue such as postcode or ZIP; the regex then expands the match to the full code.
- Recognises US 5-digit and ZIP+4 forms, UK alphanumeric postcodes, and four-digit European codes.
- Longer digit strings such as account numbers are not truncated into a postcode match.

## Why redact postal codes?

Postal code is one of the classic quasi-identifiers used to re-identify supposedly anonymous records.

## 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": "Postcode: BS8 4QA, delivery window 09:00-12:00.", "style": "replace"}'
```

## FAQ

**Does Redactly redact postal codes automatically?**

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

**What happens to postal codes after redaction?**

With style set to replace, each match becomes [contact.postal_code] — 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

- [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.
- [Dates of birth](https://bitbanger.in/entities/date-of-birth) — Redact dates of birth in numeric, ISO, and written month formats from text and tabular data.
- [GPS coordinates](https://bitbanger.in/entities/gps-coordinates) — Redact latitude and longitude pairs from delivery records, field-service notes, and mobile telemetry.

Try it on your own text: https://bitbanger.in/entities/postal-code
