XML Anonymizer
: Replace names, emails, dates and numbers in XML with realistic fake values, markup kept as writtenXML Anonymizer
Turn a real XML export into a safe copy for a bug report, a test fixture or a vendor: every name, email, phone number, date, card number and free-text value is replaced with a random value of the same kind, while the tags, attributes, namespaces, comments and whitespace stay exactly as written. It runs in your browser, so the original never leaves your device.
How to anonymize XML data
- Paste the document into
XML, pressOpen file, or drop an .xml file on the page.Exampleloads a sample order. - In
Quickmode there is nothing to set: every element text and attribute value is replaced as you type, and the info line under the result says how many values of each kind were changed. - Switch to
Customto chooseReplace with(realistic values, the same shape, or asterisks), what toChange, and field names or paths toKeep unchangedorChange only, such asstatus, @currency, /order/item. - Press
New valuesfor another set of fakes, or type aSeedin Custom mode to get the same output every time. - Press
CopyorDownloadto save the anonymized XML.
Example
A customer record in Quick mode (seed docs). Markup and indentation are untouched; each value is replaced by one of the same kind.
<customer id="20417">
<name>Margaret O'Connell</name>
<email>maggie@gmail.com</email>
<phone>+61 412 345 678</phone>
<born>1984-02-29</born>
<card>4111 1111 1111 1111</card>
</customer><customer id="84456">
<name>Sami Ingram</name>
<email>isla.moreau88@example.com</email>
<phone>+13 271 299 647</phone>
<born>1982-07-02</born>
<card>4893 4574 0416 8290</card>
</customer>Details
- Each value's kind is read from its shape first (email, URL, UUID, IP address, ISO or day/month/year date, true/false, a Luhn-valid card number, a checksum-valid IBAN, a number) and then from its element or attribute name:
firstName,surname,email,phone,city,country,street,company,username,passwordand similar names, with or without a namespace prefix. - Replacements keep the format: a card keeps its first digit, length and spacing and still passes the Luhn check; an IBAN keeps its country and spacing with valid check digits; a date stays within about three years of the original in the same layout and time zone; numbers keep their sign, digit count, decimal places and leading zeros; a UUID stays a version 4 UUID in the same case.
- Fake emails and URLs use the reserved
example.com,example.organdexample.netdomains, and IP addresses the documentation ranges192.0.2.x,198.51.100.xand203.0.113.x, so nothing in the output points at a real mailbox or server. - With
Same value → same replacementon (always on in Quick mode), a value that appears twice gets the same fake both times, so IDs that link records still match. Turn it off in Custom mode to give every occurrence its own value. Keep unchangedandChange onlytake names or paths separated by commas: a name such asstatuscovers that element or attribute anywhere and everything inside the element;@idcovers attributes only; a path such as/order/customeror/order/@idcovers that field and everything under it.- Namespace declarations (
xmlns),xml:andxsi:attributes, the XML declaration, DOCTYPE, processing instructions and whitespace-only text are never changed. Text inside CDATA sections is replaced like other text. Documents over 2 million characters wait for theAnonymizebutton and run in a background worker.
Limits
- Comments are kept unless you tick
Remove commentsin Custom mode; check them, because they can hold personal data. - Kinds are guessed from values and names. An unusual field name can get a generic replacement (letters for letters, digits for digits), and short codes such as statuses are replaced too unless you list them in
Keep unchanged. - Fakes are random, not checked against the real world: a generated phone number or name can belong to someone. Replacing values hides them, but the structure, counts and kept fields can still identify a record.
- The document must be well-formed; otherwise the error shows its line and column. Values inside the DOCTYPE's entity declarations are not changed.
FAQ
Is my XML uploaded anywhere?
No. The page parses and rewrites the document in your browser; there is no server step, and the text is not stored.
Will the anonymized file still validate against my XSD?
Usually yes: element and attribute names, order and namespaces are unchanged and values keep their format (dates stay dates, numbers stay numbers of the same length). An enumeration such as a status code can be replaced by a word outside the list, so add it to Keep unchanged or check the result with XML Validator.
How do I get the same fake values every time?
In Custom mode, type any text into Seed. The same seed and the same document always give the same output, and with Same value → same replacement on, a repeated value always gets the same fake.
Can I mask only some fields?
Yes. In Custom mode, list them in Change only (for example customer, @cardNumber), or leave everything in scope and list the fields to leave alone in Keep unchanged.
Can I anonymize JSON or CSV the same way?
Yes: JSON Anonymizer and CSV Anonymizer use the same detection and fake values.
Runs entirely in your browser. Nothing is uploaded.