Is my XML uploaded?
No. It's parsed and formatted in your browser; very large files are processed in a background worker. DTDs and external entities are never fetched.
Pretty-print or minify XML while preserving comments, CDATA, entities and xml:space; validate with line and column; test XPath; convert XML to JSON.
Loading XML Formatter…
Loading XML Formatter…
SOAP responses, sitemaps, RSS feeds, .csproj and .resx files, Android layouts, Maven POMs — XML is still everywhere, usually either minified on one line or indented inconsistently. This formatter pretty-prints XML with 2 or 4 spaces or tabs, optionally one attribute per line, and minifies it back. Unlike formatters that parse and re-serialize, it works from the original tokens, so comments, CDATA, processing instructions, the XML declaration, the DOCTYPE and entity references are kept exactly as written, text inside elements is never reflowed, and xml:space="preserve" is respected. Formatting is idempotent: formatting, minifying and formatting again gives the same result. Validation checks well-formedness — matching tags, a single root, quoted and unique attributes, defined entities, declared namespace prefixes — and reports errors with line and column. An XPath tester runs XPath 1.0 expressions with the browser's engine and lists the matches, and an XML-to-JSON mode converts documents using the common @attribute convention. External DTDs and entities are never fetched.
Elements that contain only other elements are indented, one child per line. Elements with text or mixed content are written on one line exactly as in the source. Empty elements stay as written — <a/> or <a></a>. Whitespace between tags inside a tag is normalized; attribute values and quotes are not touched.
The parser checks the XML 1.0 rules and namespace prefixes and stops at the first error with its line and column — for example "Expected </b> (opened on line 2) but found </a>" — rather than producing half-formatted output.
The tokenizer never resolves external entities or fetches DTDs, and entities declared in an internal DTD are kept as references rather than expanded, which also avoids "billion laughs" expansion attacks. A byte order mark is removed and noted.
Expressions are evaluated by the browser's built-in XPath 1.0 engine (document.evaluate). Node-set results are listed as serialized XML, attributes as name="value", and number, string and boolean results are shown directly.
Short answers for the things developers usually ask before trusting a tool.
No. It's parsed and formatted in your browser; very large files are processed in a background worker. DTDs and external entities are never fetched.
Only whitespace between elements. Text content is kept exactly: elements that contain text — including mixed content like <p>Hello <b>world</b></p> — are left on one line as written, and anything inside xml:space="preserve" is untouched. Comments, CDATA sections, processing instructions, the XML declaration, the DOCTYPE and entity references like & and © come out exactly as you wrote them.
XML only predefines five entities: & < > " '. is an HTML entity. Use the numeric reference   instead, or declare the entity in a DTD — declared entities are accepted and kept as written, not expanded.
XPath 1.0 has no default namespace, so //item won't match <item> inside xmlns="urn:…". The tester maps the document's default namespace to the prefix d:, so write //d:item. Other prefixes (soap:, xs:) work as declared in the document.
With the common convention: attributes become "@name" keys, element text becomes a string (or "#text" when the element also has attributes or children), and repeated child elements become arrays. XML and JSON don't map one-to-one, so check the result for elements that appear once in one document and several times in another.
Useful follow-ups when one conversion usually turns into three more.
Generate C# classes with XmlSerializer attributes from an XML sample — attributes, repeated elements, namespaces, CDATA and type inference.
Format, validate, and minify JSON instantly with a browser-first editor.
Collapse HTML markup, remove comments, and preview smaller output instantly.