Documents
Information types
Every sensitive-information type Redact Document finds: national IDs, dates of birth, card and bank numbers, health numbers, contact details, network identifiers, keys and passwords — with regions, formats, checks, context words and confidence.
Redact Document finds sensitive information by type. Each type is recognised in three steps:
- Format — a pattern for what it looks like (
123-45-6789,AB 12 34 56 C, 16 digits in groups). - Validation — what it must satisfy to be real: a check digit (Luhn for cards and Canadian SINs, mod-11 for NHS, IRD and Australian TFNs, mod-97 for IBANs and French NIRs, Verhoeff for Aadhaar, the ICAO 7-3-1 digits of a passport MRZ), a valid range (no SSN starts with 000, 666 or 9), a real calendar date, a known bank and branch.
- Context — words nearby (up to about 48 characters before and 24 after, in the same paragraph, cell or line) that say what it is: "SSN", "date of birth", "IRD", "passport". Some types need them (a 9-digit passport number looks like any other number), and for the rest they raise the confidence.
The result is a confidence — low, medium or high — compared with the step's Minimum confidence (default medium). Choose types in the designer by category, filter them by region, or use * (every type), @high (every type that can reach high confidence) or category:<id> in info_types.
Reference
| Type | info_types value | Category | Regions | Format | Validation | Context words | Confidence |
|---|---|---|---|---|---|---|---|
| US Social Security number | us_ssn | Identity | US | 123-45-6789, 123 45 6789; 9 digits in a row only next to a context word | Area not 000, 666 or 900–999; group not 00; serial not 0000; not all one digit | SSN, social security, SS# | medium; high with context |
| US ITIN | us_itin | Identity | US | 9XX-7X-XXXX (dashes or spaces) | Starts with 9; middle group 50–65, 70–88, 90–92 or 94–99 | ITIN, taxpayer identification | medium; high with context |
| US passport number | us_passport | Identity | US | 9 digits, or a letter and 8 digits | Context word required | passport (required) | high (with context) |
| US driver's license | us_drivers_license | Identity | US | State formats vary: up to 2 letters and 5–14 digits, or a letter and digit groups (D123-4567-8901) | Context word required | driver's license, driver license, DL, DLN (required) | medium (with context) |
| Date of birth | date_of_birth | Identity | global | Any date format: 1985-03-12, 12/03/1985, 03/12/1985, 12.03.85, 12 March 1985, Mar 12, 1985, 12-Mar-1985 | A real calendar date in the last 120 years (not in the future); the context word must come just before it on the same line (within 16 characters, no other number in between) | DOB, D.O.B., date of birth, birth date, born, birthday, geboren, né(e) le, fecha de nacimiento, data di nascita (required) | high (with context); without it the date is a plain Date |
| Date | date | Identity | global | The same formats as Date of birth | A real calendar date (day/month or month/day) | — | medium |
| UK National Insurance number | uk_nino | Identity | UK | QQ 12 34 56 C (spaces optional) | Valid prefix letters (not D, F, I, Q, U, V; second not O; not BG, GB, KN, NK, NT, TN, ZZ); suffix A–D | national insurance, NI number, NINO | medium; high with context |
| UK passport number | uk_passport | Identity | UK | 9 digits, or 2 letters and 7 digits | Context word required | passport (UK, British, HM) (required) | high (with context) |
| Canada Social Insurance number | ca_sin | Identity | CA | 046 454 286, 046-454-286 or 9 digits | Luhn check; does not start with 0 or 8 | SIN, social insurance | low (9 digits) or medium (grouped); high with context |
| Australia Tax File Number | au_tfn | Identity | AU | 123 456 782 or 8–9 digits | Weighted mod-11 checksum | TFN, tax file number | low (digits only) or medium (grouped); high with context |
| New Zealand IRD number | nz_ird | Identity | NZ | 49-091-850, 136-410-132 or 8–9 digits | IRD mod-11 check digit (primary and secondary weights); 10,000,000–150,000,000 | IRD, inland revenue, tax number, GST number | low (digits only) or medium (grouped); high with context |
| New Zealand driver licence | nz_drivers_licence | Identity | NZ | 2 letters and 6 digits: AB123456 | Context word required | driver licence, licence number, DL (required) | high (with context) |
| German tax ID (Steuer-ID) | de_tax_id | Identity | DE | 11 digits (spaces allowed): 86 095 742 719 | ISO 7064 MOD 11,10 check digit; first digit not 0; one digit repeated 2–3 times in the first ten | Steuer-ID, Steueridentifikationsnummer, IdNr, tax ID | low; high with context |
| French social security number (NIR / INSEE) | fr_nir | Identity | FR | 15 digits: 2 84 12 75 123 456 87 (Corsica 2A / 2B allowed) | Sex 1/2, month 01–12 (or 20+), and the 2-digit key (97 − number mod 97) | sécurité sociale, NIR, INSEE, numéro de sécu | medium; high with context |
| Spanish DNI / NIE | es_dni | Identity | ES | 12345678Z (DNI) or X1234567L (NIE) | Control letter (number mod 23) | DNI, NIE, documento nacional | medium; high with context |
| Italian fiscal code (codice fiscale) | it_fiscal_code | Identity | IT | 16 characters: RSSMRA85T10A562S | Structure (surname, name, year, month letter, day, place) and the control character | codice fiscale, CF | high |
| Dutch citizen service number (BSN) | nl_bsn | Identity | NL | 9 digits: 111222333, 1112.22.333 | 11-proef (elfproef) | BSN, burgerservicenummer, sofinummer | low; high with context |
| India Aadhaar number | in_aadhaar | Identity | IN | 2345 6789 0124 (12 digits, first 2–9) | Verhoeff check digit | Aadhaar, UIDAI, UID | low (digits only) or medium (grouped); high with context |
| India PAN | in_pan | Identity | IN | AAAPZ1234C | Structure: 5 letters (4th is the holder type), 4 digits, a letter | PAN, permanent account number, income tax | medium; high with context |
| Singapore NRIC / FIN | sg_nric | Identity | SG | S1234567D (S, T, F, G or M, 7 digits, a letter) | Check letter (weighted mod 11; M series by format) | NRIC, FIN, IC number | medium; high with context |
| Passport / ID machine-readable zone (MRZ) | passport_mrz | Identity | global | The P<…<<… name line and the 44-character data line of a passport (TD3), or the 30-character lines of an ID card (TD1) | ICAO 9303 check digits (document number, birth date, expiry, composite) | — | high (check digits pass); name line medium |
| Credit / debit card number | credit_card | Financial | global | 13–19 digits, spaces or dashes allowed: 4111 1111 1111 1111 | Luhn check, issuer prefix and length (Visa, Mastercard, Amex, Discover, JCB, Diners, UnionPay, Maestro) | card, credit, debit, Visa, Mastercard | high (known issuer); low (Luhn only) |
| IBAN | iban | Financial | global, EU | GB82 WEST 1234 5698 7654 32 | ISO 13616 mod-97 check | IBAN | high |
| SWIFT / BIC code | swift_bic | Financial | global | 8 or 11 characters: DEUTDEFF, DEUTDEFF500 | Bank code, a real country code, location; a context word is needed for medium | SWIFT, BIC | low; medium with context |
| US ABA routing number | us_routing_number | Financial | US | 9 digits: 021000021 | ABA 3-7-1 checksum and a valid Federal Reserve prefix | routing, ABA, RTN, transit | low; high with context |
| US bank account number | us_bank_account | Financial | US | 8–17 digits | Context word required | account number, acct, checking, savings (required) | medium (with context) |
| UK sort code and account | uk_bank_account | Financial | UK | 12-34-56 12345678; a sort code alone next to "sort code" | Sort code NN-NN-NN with an 8-digit account, or a context word | sort code, account | medium; high with context |
| Australia BSB and account | au_bank_account | Financial | AU | 062-000 12345678; a BSB alone next to "BSB" | BSB NNN-NNN with a 6–10 digit account, or a context word | BSB, account | medium; high with context |
| New Zealand bank account | nz_bank_account | Financial | NZ | 01-0902-0068389-00 (bank, branch, account, suffix) | Known bank and branch range; the Payments NZ check digit raises it to high | account, bank account | medium (bank and branch valid); high (check digit passes or context) |
| Crypto wallet address | crypto_wallet | Financial | global | Bitcoin 1… / 3… (Base58) or bc1… (Bech32); Ethereum 0x and 40 hex digits | Bitcoin: Base58Check (double SHA-256) or Bech32/Bech32m checksum. Ethereum: format | wallet, bitcoin, BTC, ethereum, ETH | Bitcoin high; Ethereum medium, high with context |
| Email address | email | Contact | global | name@example.com | Domain with a 2–24 letter top-level domain | — | high |
| Phone number | phone | Contact | global | E.164 (+64 21 555 0100) and national formats with spaces, dots, dashes or brackets | 7–15 digits; not a date; not one digit repeated | phone, tel, mobile, cell, fax, call | high (+ country code or context); medium (grouped); low (digits only) |
| Street address | postal_address | Contact | global | A number, capitalised street name and a street type (Street, Rd, Ave, …), optionally a town and postcode | Heuristic (pattern only) | address, lives at, resides, deliver to | medium; high with context |
| UK postcode | uk_postcode | Contact | UK | SW1A 1AA | Royal Mail outward / inward letters | postcode, address | medium; high with context |
| US ZIP code | us_zip | Contact | US | 94105, 94105-1234 | Context required: a state abbreviation just before it, or "ZIP" | ZIP, state abbreviation (CA 94105) (required) | medium (with context) |
| Canada postal code | ca_postal_code | Contact | CA | K1A 0B1 | Canada Post letters (no D, F, I, O, Q, U; first not W or Z) | postal code | medium; high with context |
| Australia postcode | au_postcode | Contact | AU | 4 digits after a state: NSW 2000 | Context required: state abbreviation just before it, or "postcode" | NSW, VIC, QLD, SA, WA, TAS, NT, ACT, postcode (required) | medium (with context) |
| New Zealand postcode | nz_postcode | Contact | NZ | 4 digits after a town: Wellington 6011 | Context required: a New Zealand town or city just before it, or "postcode" | Auckland, Wellington, Christchurch, … , postcode, New Zealand (required) | medium (with context) |
| UK NHS number | uk_nhs | Health | UK | 943 476 5919 or 10 digits | NHS mod-11 check digit | NHS, health service | low (10 digits) or medium (grouped); high with context |
| New Zealand NHI number | nz_nhi | Health | NZ | ZZZ0016 (3 letters, 4 digits) or the new ZZZ00AC format | NHI mod-11 (old) or mod-23 (new) check character; no I or O | NHI, national health index, patient | low; high with context |
| Australia Medicare number | au_medicare | Health | AU | 2123 45670 1 (10 digits, optional issue number) | First digit 2–6; weighted check digit | Medicare | low (digits only) or medium (grouped); high with context |
| US Medicare Beneficiary Identifier | us_mbi | Health | US | 1EG4-TE5-MK73 (11 characters) | CMS MBI structure (letters exclude S, L, O, I, B, Z) | Medicare, MBI, beneficiary | medium; high with context |
| Medical record number | medical_record_number | Health | global | 5–12 digits, optionally with a letter prefix or a dash | Context word required | MRN, medical record, patient ID, hospital number, chart number (required) | high (with context) |
| IPv4 address | ip_address | Technical | global | 192.0.2.10 | Four octets 0–255; not a version number like 1.2.3.4 in "version 1.2.3.4" | IP, host, server, address | medium; high with context |
| IPv6 address | ipv6_address | Technical | global | 2001:db8::1 | A valid IPv6 address | IP, host | high |
| MAC address | mac_address | Technical | global | 00:1A:2B:3C:4D:5E, 00-1A-…, 001a.2b3c.4d5e | Six hex pairs with one separator | MAC, hardware address, ethernet | medium; high with context |
| URL | url | Technical | global | https://… | http / https link | — | medium |
| API key or token | api_key | Credentials | global | Known prefixes (sk-, sk_live_, AKIA, ghp_, github_pat_, xoxb-, AIza, glpat-, npm_, SG.) or a long random value after key / secret / token = | Prefix and length; others: Shannon entropy ≥ 3.5 bits per character | api key, secret, token, access key | high (known prefix); medium (entropy) |
| JSON Web Token | jwt | Credentials | global | eyJ….eyJ….… | The header decodes to JSON with alg | — | high |
| Private key | private_key | Credentials | global | -----BEGIN … PRIVATE KEY----- … -----END … PRIVATE KEY----- | PEM armour | — | high |
| Password | password | Credentials | global | The value after password:, pwd=, passcode: | 4–64 characters (only the value is redacted) | password, passwd, pwd, passcode, PIN (required) | high |
| Person name (AI) | person_name | Identity | global | Names of people, found by the AI model you choose | Probabilistic: a model's judgement, not a pattern | — | medium (AI) |
"(required)" after the context words means the type is only found next to one of them.
Dates of birth
A date of birth is any date in the formats above with a date-of-birth word just before it on the same line — DOB, D.O.B., date of birth, birth date, born (on), birthday, and geboren, né(e) le, fecha de nacimiento, data di nascita, geboortedatum — at most 16 characters before it with no other number in between, or "(date of birth)" right after it. It must be a real date, not in the future and not more than 120 years ago. Numeric dates are read day-first or month-first, whichever is a real date.
| Text | Found as |
|---|---|
DOB: 12/03/1985 | Date of birth (high) |
Born on 3 March 1990 | Date of birth (high) |
1985-03-12 (date of birth) | Date of birth (high) |
Invoice date 12/03/1985 | Date (medium) |
DOB 12/03/1985, next visit 01/02/2026 | Date of birth, then Date |
DOB 05/05/2031 | Date (in the future) |
Choose Date of birth without Date to redact birth dates and keep every other date.
Overlaps
Many identifiers are runs of digits that more than one type could claim. When matches overlap, the one with the higher confidence wins, then the more specific type (an ID with a check digit before a phone number, a postcode or a plain date), then the longer match. A text is never reported or redacted twice.
Limits
- Detection is pattern-based: a number that passes a check is not necessarily what it looks like (one in eleven random 9-digit numbers passes the Dutch BSN check), and a real identifier written in an unusual way can be missed. Use Detect only on sample documents first.
- Ethereum addresses are checked by format only (no EIP-55 checksum). Singapore M-series FINs are checked by format only. A New Zealand bank account whose check digit does not match is still found, with medium confidence (bank and branch must be valid).
- Driver's licence and passport numbers, medical record numbers, US bank accounts and ZIP / Australian / New Zealand postcodes have no syntax of their own, so they are found only with a context word.
- Names of people need AI detection (probabilistic, off by default).