/
XML

2 Free Online XML Tools

These 2 XML tools exist for the documents nobody chooses to work with but everyone eventually has to open: a SOAP envelope from a partner API, a Maven pom.xml that will not build, an RSS feed, an Android layout, a sitemap, a bank statement in ISO 20022. XML Viewer & Formatter parses the document with the browser’s own XML parser, tells you immediately whether it is well-formed and on which line it is not, and then shows it three ways — as a collapsible tree you can fold down to the branch you care about, pretty-printed with the indentation you choose, or minified onto one line. XML to JSON takes the same document and re-expresses it as JSON, mapping attributes and text nodes onto keys so the result is something a JavaScript or Python program can actually index into. Both run entirely in your browser, which matters because XML payloads are so often invoices, payment messages, and integration traffic that cannot be pasted into a stranger’s server.

All 2 XML tools

What you can do with these XML tools

Between them the two tools cover reading an XML document, reshaping it, and getting out of XML altogether.

  • Check it is well-formed — a real XML parser, not a regex, so you get the exact line and column of the first error rather than "invalid XML".
  • Read it as a tree — collapse the branches you do not care about, expand the one you do, with attributes shown inline on each element.
  • Reindent it — two spaces, four spaces, or tabs, with optional attribute sorting and long start tags wrapped one attribute per line.
  • Minify it — the same parse, serialised with no indentation, so the compressed output is still guaranteed well-formed.
  • Keep meaning intact — whitespace-only text between elements is treated as layout, but mixed content, CDATA sections, comments, and processing instructions are preserved verbatim.
  • Convert to JSON — attributes prefixed with @, element text under #text, repeated siblings collapsed into arrays, with optional type inference for numbers and booleans.

Which one do you want?

Reach for XML Viewer & Formatter when XML is the destination: you are debugging a request that a server rejected, reviewing a config file, or handing a colleague a document that has to stay XML. It is also the fastest way to answer "is this even valid?" — it re-parses as you type. Reach for XML to JSON when XML is only the source and everything downstream speaks JSON: a legacy endpoint you are wrapping, a feed you are importing, a fixture you want to assert against in a test. The conversion is not lossless in both directions, and that is worth knowing before you rely on it: XML distinguishes an attribute from a child element and JSON does not, so the mapping uses an @ prefix as a convention rather than a guarantee, and an element that appears once in one document and twice in another will come back as an object in the first case and an array in the second. Convert once and keep the JSON; do not treat the two formats as interchangeable representations of the same file.

Related categories

Frequently asked questions

6

Yes. Both are free with no account, no document-size cap beyond your own device memory, and no paywalled options. They keep working offline once the page has loaded.

No. Parsing, formatting, and conversion all happen in your browser using its built-in XML parser. Nothing you paste is transmitted, logged, or stored, which is what makes these safe for SOAP traffic, invoices, and config files carrying credentials.

XML Viewer & Formatter checks well-formedness as you type and reports the line and column of the first error. Note that well-formed is not the same as valid: it confirms the syntax is correct, not that the document matches a DTD or XSD schema.

No. Whitespace between element children is treated as layout and replaced by indentation, but any element containing text is serialised inline and left exactly as it was, so text values, mixed content, and CDATA sections are never rewrapped.

XML to JSON prefixes attribute names with @ and puts an element’s own text under #text when it also has attributes or children. Repeated sibling elements with the same name become a JSON array.

The formatter handles documents up to about two million characters so it can keep up with typing; syntax highlighting switches off above 60,000 characters to stay responsive. Larger files are best split before formatting.