How to use
Paste XML into the input pane, or click “Open file” (drag & drop works too). Shift_JIS, EUC-JP and UTF-16 files are detected and decoded.
Choose a mode: Validate, Format, Minify, Tree view, XPath search or Convert to JSON. The result updates as you type.
For formatting, pick the indent, attribute line breaks, empty-element style and comment handling. A list under the result shows how whitespace was handled.
If there is an error, check the reported line, column and excerpt, and use “Go to error” to jump there. Your input is never altered.
In the tree view, copy the XPath of any element or attribute in one click. In XPath search, type an expression to see the number of matches and each hit.
Copy the result or download it. When saving you can choose UTF-8, Shift_JIS, EUC-JP or UTF-16, and the encoding in the XML declaration is updated to match.
What it does
Formatting that keeps the meaning
Only the whitespace between the child elements of element-only elements is rebuilt. Text-only elements, mixed content (text beside elements) and anything under xml:space="preserve" keep their text and whitespace exactly (tag spelling is still tidied). Comments, CDATA, processing instructions, DOCTYPE, quote styles and entity references are kept as written, and a list shows what was handled how. Formatting twice gives the same result, and format → minify → format returns the formatted text.
Errors with line, column and a fix
Mismatched or unclosed tags, duplicate attributes, unescaped & and literal < in text and more are explained with the cause and the fix. The matching start tag or first attribute is pointed out too, and “Go to error” selects the spot in the editor.
Namespace-aware validation
Undeclared prefixes are caught, and so are duplicate attributes that differ only in prefix but resolve to the same namespace. The tree and XPath search use a prefix table built from the document’s own declarations, so default-namespace elements can be addressed as d:item.
Encoding declaration mismatches
When you open a file, the real encoding (UTF-8, UTF-16, Shift_JIS, EUC-JP) is detected from the BOM and bytes and compared with the encoding in the XML declaration. When saving, the declaration is matched to the encoding you choose.
Safe by design, no network
External DTDs and external entities are never fetched (declaring an external entity is refused as an XXE guard). Entities that reference other entities, and short entities expanded in bulk, are rejected as expansion bombs. Input size, nesting depth and node count are limited.
XPath search and JSON conversion
Search runs XPath 1.0 in a stoppable background thread and lists the match count and the path of each hit, with namespace handling explained on screen. The JSON conversion rules are shown next to the result, and elements whose text order cannot be kept are counted.
Use cases
- Make an XML API response or config file readable and review changes
- Find exactly which tag is unclosed or which namespace prefix is undeclared
- Explore RSS, SVG, AndroidManifest.xml, pom.xml or SOAP documents with the tree and XPath
- Spot files whose encoding declaration disagrees with their bytes (e.g. Shift_JIS content declared as UTF-8)
- Inspect XML from outside without worrying about external entities (XXE) or entity-expansion bombs
- Turn XML into JSON to hand to other tools or scripts
Supported formats
Input
Output
Capability matrix
| Feature | Support | Notes |
|---|---|---|
| Well-formedness validation with line/column errors | Supported | — |
| Undeclared namespace prefixes and duplicate attributes | Supported | — |
| Encoding declaration vs. actual bytes | Supported | For opened files only; pasted text is Unicode |
| Format (indent, attribute wrapping, empty elements, comments) | Supported | Mixed content and xml:space="preserve" are never changed |
| Minify to one line | Supported | Only whitespace between elements is removed |
| Tree view and XPath copy (namespace-aware) | Supported | — |
| XPath 1.0 search | Supported | Runs in a separate thread (stops after 8 s; Stop button). The namespace axis, variables, id() and XPath 2.0+ are not supported |
| XML → JSON conversion | Supported | Rules shown on screen. For JSON → XML use the data converter |
| XXE and entity-expansion-bomb rejection | Supported | No network access |
| DTD entity expansion | Partial | Short text-only entities are accepted and left unexpanded; nested, markup-containing and external entities are refused |
| Schema validation (DTD / XSD / RELAX NG) | Not supported | Well-formedness only |
| XSLT transformation | Not supported | — |
| Canonical XML (C14N) and XML signatures | Not supported | — |
| XML 1.1 specifics and UTF-32 | Not supported | UTF-32 files cannot be read |
| Offline use | Supported | Works without a connection once loaded |
Limits & notes
- Up to 20 million characters (20 MB for files). Above one million characters auto-run pauses and you press “Run”.
- Nesting is limited to 1,000 levels and the total of elements, text, comments etc. to 1.5 million.
- XPath search stops after 8 seconds or when you press “Stop”. Only the first 500 matches are listed.
- DOCTYPE entities: up to 10,000 characters each, 1,000 of them, and 1 million characters produced in total.
- Line ends are normalised to LF (XML treats CR LF as a single line end anyway).
- Whitespace between the child elements of element-only elements is treated as insignificant. If a DTD makes it significant, check the output first.
- Attributes are wrapped when a start tag is longer than 100 columns (a tab counts as 4).
Privacy & safety
Your XML and files are processed only inside your browser. Nothing is sent to or stored on any server, and no external DTD, schema or entity is ever fetched. You can safely format XML that contains tokens or personal data. Closing the page discards everything.
FAQ
How do I fix an XML “end tag does not match” error?
My text contains “&” or “<” and I get an error. How do I write them?
Can formatting change the whitespace of my text?
XPath cannot find my default-namespace elements.
Is it safe against XXE and billion-laughs attacks?
What does an encoding mismatch mean?
Related tools
JSON Studio — Formatter & Validator
Paste JSON to format, minify or validate it instantly. Errors are shown with the exact line, column and cause, and comments or trailing commas can be auto-repaired. Your data never leaves your device.
YAML / TOML Studio — Validate, Format & Convert
Paste YAML, TOML or JSON to validate, format or convert it. Errors show the exact line and column, and type traps such as “no becomes false” and anything lost in conversion are flagged up front. Your data never leaves your device.
Diff Tool — Text & Code Compare
Paste or drop two versions and see added and removed lines, plus the exact words that changed inside each line. Copy or save the result as a unified patch. Nothing leaves your browser.
UUID / ULID / NanoID / Token Generator
A UUID is ready the moment the page opens. Switch to UUID v7, ULID, NanoID or a random token, generate up to 10,000 at once and save them as .txt, .csv or .json. Paste an existing UUID or ULID to read its embedded time and version.
Regex Tester
Type a pattern and matches light up in the test string instantly. Capture groups, replacement output and what each part of the pattern means are all on one screen — and patterns that would freeze your browser are stopped after one second.
Code Formatter — Format & Minify
Paste code to format it with the language auto-detected. Choose indent, line width, semicolons, quotes and trailing commas; JavaScript, CSS and HTML can also be minified with before/after size and reduction. Your code never leaves the browser.
Last updated: