About this tool
Format, minify, and inspect XML documents.
This XML editor parses a document against the XML 1.0 well-formedness rules — every open tag closed by a matching close tag, exactly one root element, no text outside that root — and then either pretty-prints it with the indent you choose or strips it back to a single line. Comments, CDATA sections, the XML declaration, processing instructions and DOCTYPE internal subsets all survive the round trip. It is for developers reading an API response, a feed or a config file that arrived as one unreadable line.
Open XML Editor on AltFTool — it loads instantly in your browser.
Paste your code or data sample into the workspace.
Pick the format, conversion, or analysis you need.
Copy the polished result straight back into your project.
A mismatched or unclosed tag is named explicitly, with the line it was found on.
Element count, unique tag names, attribute count and maximum nesting depth for the whole document.
The parser is plain JavaScript running in your tab; the document never reaches a server.
Four things: exactly one root element, every open tag matched by a close tag of the same name, correctly nested elements, and quoted attribute values. XML is case-sensitive, so <Book> and </book> do not match. Well-formed is not the same as valid — validity additionally means conforming to a DTD or XSD, which this tool does not check.
Because XML 1.0 allows only one top-level element, unlike HTML. Two sibling elements at the top of a file — a common result of concatenating two responses — is a fatal error. The fix is to wrap them in a single container element.
Only if whitespace between elements is meaningful to you, which is rare in data documents but common in mixed-content documents such as XHTML. Minifying here removes whitespace-only text nodes between elements and leaves text inside elements and CDATA sections untouched, so the parsed data is identical.
It lets you include characters that would otherwise have to be escaped — most often < and & — without entity references. Everything between <![CDATA[ and ]]> is passed through as literal text, so a snippet of code or HTML can sit inside an element unaltered. This editor preserves CDATA blocks exactly, in both formatting and minifying.