Tokenize
Your text is split into the same word pieces the model was trained on.
LIVE DEMO · PII DETECTOR
Type or paste anything below. My fine-tuned DistilBERT model finds names, emails, phone numbers, Social Security numbers, card numbers and IP addresses as you type. It runs entirely in your browser, so nothing you enter ever leaves this page.
Token key. Tokens can be turned back into the real values with this key. It stays in your browser.
| Token | Real value |
|---|
Your text is split into the same word pieces the model was trained on.
A DistilBERT model I fine-tuned labels every piece and gives a confidence score, running on your device with ONNX Runtime.
Card numbers must pass a Luhn checksum and SSNs a format check, the same rule-based safety net used in the full service.
| Type | Items | Found | Was personal data | Right type |
|---|
Found is the share of the marked items it caught (covering the item counts, since that is what hides it). Was personal data is the share of its finds that landed on something personal, like a username flagged as a name. Right type also needs the label to match. Full results
The model is free, and so is a small Python package that wraps it with the same checks this page uses. Two steps get it running.
You need Python 3.9 or newer. Then run this in a terminal:
pip install chad-piiSave this as redact_me.py and run python redact_me.py. The first run downloads the model (about 260 MB) from Hugging Face. After that it works offline, and nothing you redact is sent anywhere.
from chad_pii import redact, tokenize, restore
text = "Hi, I'm Sarah Johnson. Email sarah.j@example.com or call 6626341142."
print(redact(text)) # labels
print(redact(text, mode="mask")) # black bars
print(redact(text, mode="fake")) # realistic fake values
safe, key = tokenize(text) # reversible tokens
print(safe)
print(restore(safe, key) == text)It prints:
Hi, I'm [PERSON]. Email [EMAIL] or call [PHONE].
Hi, I'm █████████████. Email ███████████████████ or call ██████████.
Hi, I'm Drew Bennett. Email jamie.ellis@example.com or call (202) 555-0184.
Hi, I'm <PERSON_1>. Email <EMAIL_1> or call <PHONE_1>.
TrueUse find(text) to get each item's type, position and confidence, or run chad-pii "some text" on the command line. The package checks card numbers with Luhn, IBANs with their bank checksum and SSNs by format, and catches 10-digit phone numbers with a real area code. See chad-pii on PyPI, or use the raw model with transformers from Hugging Face.
This is a demo of a research model, so it can miss things or flag things by mistake. Please don't rely on it for real compliance work.