Indent XML, minify it, and see the first error by line and column
Runs in your browser. Nothing you type is sent anywhere. Updated on 24 Oct 2026.Formatting XML indents nested elements so the hierarchy becomes visible, and minifying strips that whitespace out again. A malformed document is reported by line and column, so you go straight to line 47 instead of hunting. Everything is parsed in your browser.
Paste the document into the XML box, or press Try an example.
Pick Format to indent it, Minify to strip the indentation, or Validate to check it is well formed.
If the document is broken, read the line, column and hint under the box and fix that spot.
Press Copy or Download to take the formatted or minified XML.
This XML formatter does three jobs from one box. Format indents the document as a tree, one element per line, at two spaces, four spaces or a tab. Validate checks that the document is well formed and, when it is not, gives you the first real problem with its line and column. Minify strips the indentation and, if you want, the comments, and shows the bytes saved.
XML tends to arrive in an awkward state. A SOAP response or an API payload is one line thousands of characters long. A feed from a partner is rejected by your importer with nothing more than "invalid XML". A config file has been edited by three people and no longer lines up. All three are a paste away from readable here.
The validator checks what XML actually requires: one root element, every tag closed by its own name in the right order, attribute values in quotes and never set twice, ampersands written as entities, and nothing but whitespace and comments outside the root. Messages say what to change, such as which element was opened earlier and has to be closed first. It does not check against a DTD or an XSD schema; it checks that the document is well formed, which is the failure people actually hit.
Minifying removes only whitespace that sits between elements, because in XML the text inside an element is data. Text with content in it, along with CDATA sections, is copied character for character. Everything runs in your browser, so payloads with customer records in them never leave your device.
Yes. No signup, no document size limit and no cap on how often you use it. The page is paid for by a few ads shown outside the tool, and nothing is added to your document.
No. Formatting, validating and minifying all run in your browser with JavaScript. A payload containing customer records, order numbers or an internal endpoint never leaves your device and is not stored anywhere.
Paste it and the first problem is shown with its line and column, next to the input. Typical answers are a tag closed by the wrong name, an attribute value missing its quote, a bare ampersand that should be &, or a second root element.
No. It checks that the document is well formed: one root, correctly nested and closed tags, quoted attributes and valid entities. Schema validation needs the schema itself and is a different job. Well-formedness is what most rejected files actually fail.
No. Only whitespace between elements is removed, because that is indentation a formatter added. Text inside an element is the data, so it is copied exactly, and CDATA sections are left untouched. Comments are removed unless you keep them.
Yes. Both are ordinary XML. Paste the whole response, including the XML declaration, and it comes back as an indented tree. Namespace prefixes such as soap: and content: are element names like any other and are preserved.
Still stuck? Ask about XML Formatter & Validator and anybody who knows can answer. No account needed.
Same job, other tools: GraphQL Validator – Check a GraphQL query or schema for errors, optionally against your own SDL · JSON Validator – Check JSON and see exactly where it breaks · JSON Minifier – Strip whitespace from JSON for production · HTML Minifier – Strip comments and spare whitespace from HTML and see the saving · CSS Minifier – Compress a stylesheet and see exactly how many bytes you saved.
On the related tools: Markdown to HTML – Convert Markdown into clean, safe HTML you can paste anywhere.
Also works as: XML Beautifier.
In the collection Code Formatters and Minifiers.