XML Formatter
DeveloperPretty-print XML with proper indentation, minify it for transport, and validate it against the browser's own parser so syntax errors are reported with their real location.
Runs entirely in your browser. Nothing is uploaded.
Format, minify & validate XML
XML arriving from an API or a config export is usually one unbroken line, which makes the structure impossible to follow and a missing closing tag impossible to spot. This formatter indents it by nesting depth so the hierarchy is visible, minifies it again when you need to send it, and validates it with the browser's own XML parser — which means a syntax error is reported with its actual location rather than a vague complaint.
How to format and validate XML
- 1
Paste your XML
A response, feed, config file, or fragment.
- 2
Format or minify
Indent it to read the structure, or strip the whitespace and comments for transport.
- 3
Fix what is reported
Malformed XML produces the parser's own error message, including where it gave up.
Good to know
- Validation checks well-formedness — balanced tags, valid entities, a single root element — not conformance to a DTD or XSD schema.
- Minifying removes whitespace between elements, which is insignificant in most documents but is content inside mixed-content elements, so check formatted text survives.
- The root element name and element count are reported, which is a quick sanity check that you pasted what you meant to.
- Parsing happens in your browser, so feeds and configs containing keys or customer data stay local.
What people use it for
- Making a single-line XML API response readable while debugging
- Finding the unbalanced tag in a config file that will not load
- Minifying an XML payload before sending it in a request
Frequently asked questions
How is the XML validated?+
With the browser's built-in DOMParser, which reports the actual parse error and its position rather than guessing from a pattern. Well-formedness is checked, not conformance to a schema.
Does it validate against a DTD or XSD?+
No. It checks that the document is well-formed XML — tags balanced, entities valid, one root element. Validating against a specific schema needs a dedicated validator.
Will minifying break my XML?+
Whitespace between elements is removed, which is insignificant in most documents but is preserved content inside mixed-content elements. Check the result if your XML holds formatted text.
Is my data sent to a server?+
No. Formatting XML happens entirely in your browser using built-in web APIs. Nothing is uploaded, stored, or logged.
Related tools
JSON Formatter
Beautify, minify & validate JSON
Base64 Encode / Decode
Text ⇄ Base64
URL Encode / Decode
Escape & unescape URL components
JWT Decoder
Inspect JSON Web Tokens
Or browse all 50 free tools.
