XML Viewer & Formatter
Paste XML to validate, pretty-print, or minify it. Everything runs in your browser, so your data never leaves your machine.
DOMParser. Nothing is uploaded or logged.About the XML Viewer & Formatter
The XML Viewer & Formatter validates, pretty-prints, and minifies XML so you can read its structure and confirm it is well-formed before using it. It is built for developers, WordPress and feed integrators, and anyone working with RSS, sitemaps, SVG, config files, or API responses. Everything runs 100% in your browser using the native DOMParser, so your data stays private and is never uploaded.
How it works
- Paste or type your XML into the input area.
- Click Format to indent the document, or Minify to strip whitespace; pick 2 spaces, 4 spaces, or a tab for the indent style.
- Read the status bar for the validation result and the element, attribute, and text-node counts; if the XML is malformed, the parser error message shows what went wrong.
- Click Copy to grab the formatted output.
Features
- Validation with the native DOMParser and a clear message when the document is malformed.
- Format (pretty-print) with a choice of 2 spaces, 4 spaces, or tab indentation.
- Minify to remove whitespace between tags for the smallest output.
- Syntax coloring for tags, attributes, values, comments, and CDATA.
- Live counts for elements, attributes, and text nodes, plus output byte size, and one-click copy.
Frequently asked questions
Is my XML uploaded anywhere?
No. Parsing, validation, and formatting all happen in your browser using the native DOMParser. Nothing is sent to a server or logged.
Why does it say my XML is invalid?
Common causes are an unclosed or mismatched tag, more than one root element, a missing quote on an attribute, or a stray < or & that is not escaped. The parser error message points to the problem.
What is the difference between Format and Minify?
Format pretty-prints the document with indentation and line breaks so it is easy to read. Minify removes the whitespace between tags to produce the most compact output for storage or transfer.
Does it handle comments, CDATA, and the XML declaration?
Yes. Comments, CDATA sections, the XML declaration, and processing instructions are preserved in the output and colored so they stand out from element content.
Does it work offline and with large files?
Once the page has loaded it runs locally, so it keeps working without a connection. There is no fixed size limit; very large documents are constrained only by your device's memory and may format more slowly.