🛡️ Data Masking Tool – Protect PII & Secrets Before Sharing
The Data Masking Tool lets you safely sanitize logs, API responses, database exports, and configuration snippets by replacing sensitive values with masked equivalents — while preserving the overall structure of your data. Whether you need to redact personally identifiable information (PII) before filing a bug report or generate realistic test records from production data, this tool runs entirely in your browser so your data never leaves your device.
🔍 Auto-Detected PII Types
Enable Auto PII Detection to instantly identify and mask the most common sensitive data types without any configuration:
| PII Type | Pattern Example | Detection Regex |
|---|---|---|
john@example.com | [a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,} | |
| SSN | 123-45-6789 | \d{3}-\d{2}-\d{4} |
| Credit Card | 4111-1111-1111-1111 | \d{4}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4} |
| Phone | 555-867-5309 | \(?\d{3}\)?[.\- ]?\d{3}[.\- ]?\d{4} |
| IPv4 | 192.168.1.100 | \d{1,3}(\.\d{1,3}){3} |
| API Key | sk-abc123...xyz | [A-Za-z0-9_\-]{32,} |
🎭 Masking Strategies Explained
Choose the strategy that best fits your use case. Each mode transforms matched values differently while leaving non-sensitive content intact.
Replaces every character of the matched value with the mask character. Use when the data consumer must not see any portion of the original value.
john.doe@company.com → ********************
Keeps a configurable number of leading and trailing characters visible, masking only the middle. Ideal for UI displays where you need to confirm an identity without exposing the full value (e.g., ****@example.com).
123-45-6789 (prefix 3, suffix 4) → 123-***-6789
Replaces digits with random digits and letters with random letters while preserving all punctuation and structure. The output is structurally valid but contains no real data — perfect for generating test datasets from production records.
4111-1111-1111-1111 → 7382-5940-2817-3056
Replaces the entire matched value with a descriptive semantic tag regardless of the original length. Makes redacted areas self-documenting in logs and reports.
alice@example.com → [EMAIL_REDACTED]
Generates a deterministic token from a user-supplied seed so the same input always produces the same masked output. Enables consistent cross-record anonymization where referential integrity matters (e.g., joining tables on a masked user ID).
John Doe (seed: mySeed42) → USR_a3f9b21c
🎯 Targeting Specific Fields
Beyond auto-detection, you can supply a comma-separated list of target field names or regex patterns to mask domain-specific sensitive values. For example, entering api_key, internal_id, employee_number will match those literal strings as patterns in your input. An exclusion listlets you whitelist fields like id, timestamp that should always pass through unmasked — even if they match an auto-detected pattern.
📊 Masking Coverage Meter
After applying masking, the tool displays a coverage percentage — the ratio of masked characters to total input characters. A low coverage (green) means only a small fraction of your data was sensitive. High coverage (red) may indicate an overly aggressive masking configuration. The Summary Table tab provides a per-occurrence breakdown showing the PII type detected, strategy applied, original value, and its masked counterpart. The Side-by-Side Diff tab shows original vs. masked output for easy visual comparison.
🔒 Privacy & Security
All masking is performed entirely in your browser using client-side JavaScript. No input data is transmitted to any server, logged, or stored anywhere beyond your browser session. This makes the tool safe for use with real production data, customer PII, and internal secrets — you remain in full control at all times.
💡 Common Use Cases
- Bug reports & support tickets — Paste a JSON payload, mask emails and tokens, then share the sanitized version with a third-party support team.
- Test data generation — Use format-preserving mode on a production CSV export to produce a structurally identical but anonymized dataset for staging environments.
- Documentation examples — Replace real API keys and credentials in code snippets before publishing tutorials or README files.
- GDPR / CCPA compliance demos — Demonstrate data anonymization workflows to auditors without exposing real customer records.