XML Formatter
Format, validate and beautify XML data
About XML Formatter
XML Formatter re-serializes your XML with consistent indentation so deeply nested elements and attributes become readable. It surfaces well-formedness errors — unclosed tags, mismatched case, missing root element — that would cause any conformant parser to reject the document. Handy for reading SOAP envelopes, inspecting RSS/Atom feeds, editing Android resource files, and decoding SAML assertions before they hit your IdP.
Common Use Cases
Frequently Asked Questions
How is XML different from HTML?
XML is case-sensitive (<Item> and <item> are different elements), every element must be explicitly closed or self-closed (<br/> not <br>), and there are no implicit elements — the parser does not infer missing tags. HTML is defined with lenient parsing rules to handle real-world markup errors; XML has none of that tolerance.
What are CDATA sections?
A CDATA section (<![CDATA[ ... ]]>) wraps content that would otherwise need escaping, such as a block of JavaScript or SQL. The parser treats everything inside as character data and ignores markup characters like < and &. Use it when you need to embed code or structured text inside an XML element without escaping every special character.
What are XML namespaces?
Namespaces (xmlns:prefix="uri") prevent element name collisions when combining XML vocabularies — for example, SOAP uses soap:Envelope while a payload inside might use its own envelope element. The URI is just a unique identifier; it does not need to resolve to a real document.
Why is XML heavier than JSON?
XML repeats every element name in both the opening and closing tag, attributes add quoting overhead, and namespaces add URI prefixes throughout. JSON represents the same data with less redundancy. XML's verbosity comes with benefits — mixed content (text interleaved with markup), comments, processing instructions, and schemas like XSD — but for plain data exchange JSON is almost always smaller and faster to parse.