PII Masker
The PII Masker finds personal data in pasted text — emails, phone numbers, card numbers, IP addresses, dates of birth and API-key-like tokens — and replaces it with ***, a masked form, or a stable placeholder, entirely in your browser.
How to Use
- 1
Paste the text into the editor — a log excerpt, a support ticket, or a prompt draft. The sample button loads fake example data (a made-up email, phone number, card number and API key) so you can try the tool without real data.
- 2
Pick a masking mode. Redact replaces every match with ***. Mask keeps the first and last characters (j***@example.com, **** **** **** 4242) so the text stays readable. Tokenize replaces each distinct value with a stable placeholder like [EMAIL-1].
- 3
Choose what to look for. All six types are on by default — emails, phone numbers, card numbers, IPv4 addresses, dates of birth and API-key-like tokens. Switch any type off and its matches stay in the text.
- 4
Read the masked output and the findings table: each match shows its type, its masked value, and its character position, so you can check every match against its context before you copy anything.
- 5
Copy the masked text or download it as masked.txt. In Tokenize mode, the placeholder mapping is hidden behind a Show mapping button — it reverses the masking, so keep it private and store it separately from the masked text.
- 6
Re-read the output before sharing it. The tool does not detect names, and anything that does not match a pattern passes through unchanged — a clean result is not proof the text is free of personal data.
Frequently Asked Questions
What is PII masking?
Is my text uploaded to a server?
What exactly does it detect?
Why was my card number left unmasked?
Redact vs Mask vs Tokenize — which should I use?
Is the Tokenize mapping safe to share?
Does masking make text GDPR- or HIPAA-compliant?
Can it miss personal data?
Can it mask things that are not personal data?
Should I paste real customer data or real secrets here?
Generative Answer & AI Documentation
What is the PII Masker?
The PII Masker takes plain text — a log excerpt, a support ticket, a prompt draft — and scans it for six kinds of personally identifiable information (PII) using pattern matching: email addresses; phone numbers in international (+1 415-555-0132) or North American ((415) 555-0132) format; 13–19 digit card numbers that pass the Luhn checksum; IPv4 addresses; dates of birth written as 1990-05-14, 14/05/1990, 14 May 1990 or May 14, 1990; and API-key-like tokens such as sk-…, AKIA…, ghp_… and xox…- strings, plus long mixed-case tokens. Each match is listed in a findings table with its type, its masked value and its character position, so you can check every match against its context. Three masking modes are offered: Redact replaces every match with ***; Mask keeps the first and last characters (j***@example.com, **** **** **** 4242, 192.168.1.***) so the text stays readable; Tokenize replaces each distinct value with a stable placeholder such as [EMAIL-1], so the same value always maps to the same placeholder. The placeholder mapping is hidden behind a Show mapping button, because the mapping reverses the masking. Everything runs in the tab: the text is never uploaded.
Why use PII Masker offline?
The moment that creates the need for this tool is mundane and constant: you are about to paste something into an AI chat, a support ticket, or a log file, and the text contains a customer's email, a phone number, or a key that should not travel with it. The careful move is to strip those values first — but doing it by hand is slow and unreliable, because the eye skips the third email address in a long log and misses the phone number formatted with parentheses. A masking tool does the tedious scan for you, and does it the same way every time. Doing it locally matters for the same reason the scan matters: the text you are cleaning is, by definition, text you do not want to share, so sending it to a server-side redaction service trades one exposure for another. Here the text never leaves the tab, which is the only privacy promise a page like this can honestly make — and it is also why the page is blunt about its limits. Masking is a hygiene step, not a guarantee: it reduces what a shared copy reveals, but a masked document can still be identifying, and a missed match stays visible in the output you copy.
When should you use this tool?
Use it before pasting a log excerpt into an AI assistant or a public issue tracker; before forwarding a support ticket that quotes a customer's email and phone number; before sharing a prompt that contains a test API key; before posting a stack trace that includes a server IP and a user email; and before handing a dataset sample to a colleague. Use Mask mode when the reader still needs to tell values apart — two masked emails in one ticket, or a card's last four digits for a support agent to confirm. Use Tokenize mode when the structure of the text matters and you will restore the values later, for example when sending a prompt to an AI and swapping the placeholders back afterwards. Use Redact when nothing about the values needs to survive. Do not use it as your only privacy control for real customer data or real secrets: read the output before sharing it, and prefer your own redaction step in a system you control for anything regulated.
Key Benefits
- Six detectors in one pass — email, phone, card, IPv4, date of birth and API-key-like tokens — with a findings table that shows the type, masked value and position of every match.
- Three honest modes: Redact (***) for maximum hiding, Mask (first/last characters kept) for readable output, Tokenize ([EMAIL-1]) for reversible, structure-preserving placeholders.
- Card numbers are only masked when they pass the Luhn checksum, so order and reference numbers are not silently destroyed — and failed runs are reported, not hidden.
- Per-type toggles: switch any detector off and its matches stay in the text, so a date that is a deadline rather than a birth date can be kept.
- Tokenize mapping hidden by default behind a Show mapping button, with a plain-language warning that the mapping reverses the masking.
- Copy the masked text or download it as masked.txt — no signup, no upload, no limits, works offline once loaded.
Common Use Cases
- Cleaning a prompt before an AI chat: a draft that reads 'Hi, I'm Jane Doe — reach me at jane.doe@example.com or call (415) 555-0132' becomes 'Hi, I'm Jane Doe — reach me at j***@example.com or call (***) ***-0132' in Mask mode. Note the name survives — names are not detected, and the page says so.
- Scrubbing a log before filing a bug report: server IPs become 10.0.0.*** and the test API key becomes sk-l***5678, so the pasted log no longer hands out infrastructure details.
- Preparing a support ticket: Mask mode keeps the last four digits of a card (**** **** **** 4242) so the agent can confirm which card the customer means, without the full number travelling in the ticket.
- Tokenizing a dataset sample: every occurrence of the same email becomes [EMAIL-1] throughout, so the sample keeps its structure — the same customer in every row — while the real address never leaves your machine.
- Checking a pasted secret: if a 16-digit number stays visible after masking, it failed the Luhn check — either it is not a card number, or it is a mistyped one, and the page tells you which count it skipped.
Developer Notes & Best Practices
Detection is regex heuristics plus two validators. Card candidates — digit runs of 13 to 19 digits, optionally grouped with spaces or hyphens — only count when they pass the Luhn checksum, the same check payment systems use to catch typos; a run that fails is left visible and counted in the 'left unmasked' note. Dates of birth are validated as real calendar dates, so 31 February and 29 February 2023 (not a leap year) are not matched, while 29 February 2024 is. IPv4 matches are validated octet by octet, so 999.1.1.1 is not matched, and a dotted version number such as 1.2.3.4.5 is not matched either. Overlaps are resolved by priority — a card number is never also reported as a phone number. The masked forms are fixed per type: email keeps the first character of the local part and the whole domain (j***@example.com); phone and card keep the last four digits and star the rest, preserving separators; IPv4 masks the last octet; a date of birth keeps the year and stars the day and month; an API key keeps its first and last four characters. Deliberate gaps: bare 10-digit runs are not treated as phone numbers, because in real text they are usually order or reference numbers; and names, passport numbers and national ID numbers have no detector at all. If your data contains those, this tool will not find them — that is a stated limit, not an oversight to discover in production.
What each type becomes in Mask mode
| Type | Example input | Masked output | What is kept |
|---|---|---|---|
| jane.doe@example.com | j***@example.com | First character + full domain | |
| Phone | (415) 555-0132 | (***) ***-0132 | Last 4 digits |
| Card number | 4242 4242 4242 4242 | **** **** **** 4242 | Last 4 digits (Luhn-checked) |
| IPv4 address | 192.168.1.5 | 192.168.1.*** | First three octets |
| Date of birth | 1990-05-14 | 1990-**-** | Year only |
| API key | sk-live-abcdefgh12345678 | sk-l***5678 | First 4 + last 4 characters |
The three masking modes
| Mode | Output for jane.doe@example.com | When to use it |
|---|---|---|
| Redact | *** | Sharing: nothing about the value needs to survive. |
| Mask | j***@example.com | Support and debugging: the reader must tell values apart. |
| Tokenize | [EMAIL-1] | AI prompts and samples: structure matters, values are restored later. |
What the tool does NOT detect
| Not detected | Why | What to do instead |
|---|---|---|
| Person names | There is no pattern for a name. | Remove or replace names by hand before sharing. |
| Passport / national ID numbers | Formats vary by country; no safe generic pattern. | Handle in your own redaction step, in a system you control. |
| Bare 10-digit runs | Usually order or reference numbers, not phones. | If it is a phone number, format it with separators or a + prefix. |
| Card numbers that fail Luhn | A failed check means probably not a card — or a mistyped one. | Check the digits; the page reports how many runs it skipped. |
| Dates that are not birth dates | A date pattern cannot tell a deadline from a birthday. | Switch the date detector off for that paste, or check the findings table. |
- Always re-read the masked output before sharing it — a clean result means no pattern matched, not that the text is free of personal data.
- Use the fake sample button to learn the tool, and never paste real customer data or real secrets for a first try.
- Prefer Redact (***) when the values do not need to survive; prefer Mask when a support agent needs the last four digits to confirm which card or account is meant.
- In Tokenize mode, store the mapping separately from the masked text and never paste both into the same chat, ticket, or log — the mapping reverses the masking.
- If a value you expected to be masked stays visible, check the findings table first: it may be a type you switched off, a card that failed the Luhn check, or a format the detectors do not recognise.
- For real customer data or anything regulated, treat this page as a hygiene step only — your own redaction process in a system you control is the control that counts.
Common Mistakes
- Trusting a clean result: zero matches means no pattern matched, not that the text is safe — names and unrecognised formats are still in there.
- Sharing the Tokenize mapping with the masked text: the mapping restores every original value, so pasting both into the same ticket undoes the masking.
- Pasting real secrets to test the tool: use the fake sample instead — the page never uploads anything, but a missed match in a real secret stays visible in the output you copy.
- Assuming Mask mode hides everything: j***@example.com still reveals the domain and the first letter, and a masked card still shows its last four digits — that is the point of Mask mode, and the wrong choice if the value must not survive at all.
- Forgetting that a Luhn failure is a signal, not a bug: a 16-digit number left visible is either not a card, or a mistyped card — check the digits instead of assuming the tool is broken.
- Treating masked output as compliant: masking is a hygiene step before sharing, not a GDPR or HIPAA guarantee, and this page does not claim otherwise.
Limitations
The honest limit is the method itself: regex heuristics find things that look like personal data, and they miss everything that does not match a pattern. Names are never detected. Passport and national ID numbers are never detected. Phone numbers in formats the tool does not recognise — including bare 10-digit runs, which are deliberately not treated as phones — pass through unchanged. A card number with a typo fails the Luhn check and stays visible. A date that is a deadline is masked exactly like a date that is a birthday, and a long mixed-case string that looks like a token is masked whether or not it is one. Masking also does not make text compliant with GDPR, HIPAA, or any other regulation: pseudonymised data is still personal data under GDPR, and whether a masked document meets a regulation depends on what remains, who can reverse it, and your own legal process. The page claims none of that. Its one solid promise is about handling: the text never leaves your browser.
Structured Input/Output Example
Hi, I'm Jane Doe — reach me at jane.doe@example.com or call (415) 555-0132. My card is 4242 4242 4242 4242, the office server is 10.0.0.5, and I was born on 1990-05-14.
Hi, I'm Jane Doe — reach me at j***@example.com or call (***) ***-0132. My card is **** **** **** 4242, the office server is 10.0.0.***, and I was born on 1990-**-**. (5 matches: 1 email, 1 phone, 1 card, 1 IPv4, 1 date of birth)
Related Tools
Regex Tester
Regex tester: debug regular expressions with live match highlighting, match counts, and instant syntax feedback. Flags g, i, m, s supported.
JWT Decoder Offline
JWT decoder offline: inspect a token’s header, payload claims, and expiry as readable JSON. 100% client-side — production tokens never leave your browser.
Password Generator
Password generator: create strong, unpredictable passwords with real cryptographic randomness — not Math.random(). Pick length and character sets.
Hash Generator
Hash generator: type any text and get its MD5, SHA-1, and SHA-256 digests side by side in real time. Compare algorithms at a glance. Free, offline.
Subnet Calculator
Subnet calculator: IPv4 and IPv6 CIDR math — network, broadcast, first/last host, usable hosts, split into subnets, VLSM, and an AI-answer check.