SQL Query Anonymizer

Paste a production query, replace customer PII with stable fake values in this browser, then copy the result into an AI chat or a local EXPLAIN. The SQL shape stays; the people do not.

SQL Query Anonymizer / Data Masker

Replace PII in SQL strings with stable mock values. The query should still parse. Nothing is uploaded.

Heuristic masker, not a compliance product. Read the output before it leaves your machine.

Why logs and queries are different jobs

The Log Anonymizer turns secrets into labels ([EMAIL:a3f2]). That is correct for a Slack paste.

A query you want to run still needs values that look like data: an email that parses, a phone that is still a phone, the same original email mapping to the same fake so a self-join does not fall apart. Labels break EXPLAIN, local seeds, and “will this predicate use the index?”.

This page tokenizes SQL strings and comments, then swaps emails, phones, SSNs, card-shaped numbers, IPs, UUIDs, and name-like literals for mock values. Identifiers (users.email) stay. Heuristics miss odd formats and can over-mask a string that merely looks like a name — read the output.

What it will not promise

  • It is not a compliance product and not a full SQL parser.
  • Column names, comments with unusual IDs, and national ID formats it does not know will leak if you do not look.
  • Closing the tab is the cleanup. Nothing is stored.

For pretty-printing after you mask, use the SQL Formatter.