# Redact national ID numbers

> Redact national identity numbers such as NIN, DNI, PESEL, and similar government identifiers.

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

Category: Identity and government IDs · Entity type: `identity.national_id`

National identifiers differ in length and format from country to country, which is why this type combines a model pass with a context cue rather than a single regex.

## How Redactly detects national ID numbers

- Detected from a national-ID cue such as national ID, NIN, DNI, or 身份证, followed by the value.
- No country-specific format is assumed: the label supplies the meaning and the value is captured as written.
- A value after a passport, licence, or tax cue is reported under that type instead.

## Why redact national ID numbers?

National IDs anchor identity in most jurisdictions and are the primary key in identity-fraud databases.

## 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": "KYC completed, national ID 1234 5678 9012 verified.", "style": "replace"}'
```

## FAQ

**Does Redactly redact national ID numbers automatically?**

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

**What happens to national ID numbers after redaction?**

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

- [Social Security numbers](https://bitbanger.in/entities/ssn) — Redact US Social Security numbers in 3-2-4 format from text, JSON, and CSV. Format-matched, with no model dependency.
- [Passport numbers](https://bitbanger.in/entities/passport) — Redact passport numbers from travel documents, onboarding packets, and KYC notes.
- [Tax identification numbers](https://bitbanger.in/entities/tax-id) — Redact TINs, EINs, and equivalent tax identifiers from invoices, payroll files, and vendor records.

Try it on your own text: https://bitbanger.in/entities/national-id
