What the XML tools do
XML still underpins a great deal of software: SOAP and enterprise APIs, RSS and Atom feeds, sitemaps, Android layouts and manifests, Maven and NuGet configs, SVG, Office documents and invoicing standards. This tool validates an XML document for well-formedness, beautifies it with proper indentation, and converts it to JSON so it can be read or processed by tools that only speak JSON. Parsing uses the browser's built-in XML parser and nothing is uploaded.
Well-formed vs valid
XML has two levels of correctness. A document is well-formed when it follows the basic rules: a single root element, every tag closed, tags properly nested, attribute values quoted, special characters escaped. It is valid when it also conforms to a schema (DTD, XSD or RelaxNG) describing which elements are allowed where. This tool checks well-formedness — the level at which parsers refuse to read a file at all. Schema validation needs the schema and a tool such as xmllint or an IDE.
| Rule | Wrong | Right |
|---|---|---|
| Close every element | <item>text | <item>text</item> |
| Nest properly | <b><i>text</b></i> | <b><i>text</i></b> |
| Quote attributes | <a href=x> | <a href="x"> |
| Escape & < > | <p>Tom & Jerry</p> | <p>Tom & Jerry</p> |
| One root element | <a/><b/> | <root><a/><b/></root> |
| Case-sensitive names | <Item></item> | <item></item> |
Beautify: what changes
Before:
<order id="42"><customer><name>Ana</name><email>ana@example.com</email></customer><items><item sku="A1" qty="2"/></items></order>
After:
<order id="42">
<customer>
<name>Ana</name>
<email>ana@example.com</email>
</customer>
<items>
<item sku="A1" qty="2"/>
</items>
</order>Elements are indented by nesting depth, one element per line, with text-only elements kept on a single line. Attribute order, comments, CDATA sections and processing instructions are preserved. Whitespace inside text content is left alone, since in XML it can be significant.
Convert to JSON
XML and JSON do not map one-to-one, so the converter follows common conventions: elements become object keys, repeated elements become arrays, attributes are stored with an @ prefix, and text content of an element that also has attributes goes under #text.
<item sku="A1" qty="2">Widget</item>
{ "item": { "@sku": "A1", "@qty": "2", "#text": "Widget" } }- All values come out as strings — XML has no numeric type. Convert in your code if needed.
- Namespaces are kept in the key names (
soap:Body). - A single child that might repeat in other documents will appear as an object, not a one-element array; handle both in consuming code.
- Comments and processing instructions are dropped.
Common uses
- Reading a SOAP response or an RSS feed pulled from a log.
- Cleaning up a minified sitemap or a hand-edited Android manifest.
- Finding the unclosed tag that makes a config file fail to load.
- Turning an XML export into JSON for a script or a spreadsheet import.
- Inspecting the structure of an SVG or an Office document part.