Masking: The Digits You Keep Are Data Too

Open Tool PII Masker

The goal is irreversibility

Masking replaces part of a sensitive field with a mask so viewers cannot identify the subject while format remains verifiable. Phone numbers keep three digits at each end with four hidden; identity numbers keep six and four with the birth date hidden; emails hide the middle of the local part; names keep the surname; bank cards keep the last four. How much to keep is a trade: more helps manual checks, less is safer. The tool handles each type automatically and accepts a custom prefix length, with copyable or downloadable output.

Steps

  1. Paste the values, one per line.
  2. Pick the type: phone, identity number, email, name or bank card.
  3. Adjust the kept digits by compliance need rather than convenience.
  4. Run it and check each mask sits in the right position.
  5. Copy or download, confirming the file holds no originals.
  6. Clear for the next batch.

Combined fields and reversibility

One masked field is not enough, since combinations re-identify people: a partly hidden phone plus region, age and order number still narrows to one person. Fields in one dataset need joint treatment, and whole records may become identifiers. Mask characters must stay consistent, or downstream matching fails. Any mapping table needs separate encrypted storage, because a leaked map cancels the masking. How much to keep depends on purpose: support staff need the last four, public logs should hold none. Masked values usually fail format validation, so display and validation need separate paths.

Common mistakes

Keeping too many digits, where region plus tail re-identifies. Masking in one place while logs or screenshots keep originals. Mixed mask characters breaking downstream regexes. A plaintext mapping table making masking pointless. Feeding masked values into validators that reject them. And unredacted screenshots undoing the work.

Where masking is not anonymity

Anonymity requires non-re-identifiability, usually through generalisation, suppression or differential privacy. Statutory retention and audit follow regulator rules rather than tool defaults. Sample data shared externally needs compliance review, not just processing. Training datasets need re-identification risk assessment. And publishing masked output as public data requires a risk review first.

⏫︎