XML Viewer

Paste XML to validate it and explore the structure as a collapsible tree or JSON.

XML → structure
XML
Parsed
Paste XML to view its structure.
Waiting for XML…

What this tool does

Paste an XML document and this viewer parses it with the browser's own spec-compliant XML engine into a structure you can explore — expand and collapse the tree to inspect elements, attributes, and text nodes, or switch to JSON for the converted equivalent. It validates as you type and underlines the line where parsing fails, which is usually all you need to find the mismatched tag in a config file, feed, or API payload. Everything runs in your browser.

How to use it

  1. Paste your XML into the left pane — or hit Upload to open an .xml file from your machine.
  2. Watch it parse live. The status bar turns green when the document is valid — showing the root element and element count — or names the failing line when it isn't.
  3. Explore the Tree — attributes appear as @name keys, repeated tags as arrays — or switch to JSON for the converted structure.
  4. Copy JSON, or open the Download menu to save the structure as .json or the source as .xml.

Frequently asked questions

Is my XML uploaded anywhere?
No. Parsing runs entirely in your browser, using its native XML parser. Nothing is sent to a server, logged, or stored.
How are attributes and repeated elements shown?
Attributes appear as @name keys on their element, repeated sibling tags collapse into an array, and mixed content keeps its text under #text — the same shape the XML → JSON converter produces, so the two tools agree.
What happens when the XML is invalid?
The status bar turns red and names the failing line along with the parser’s reason — a tag mismatch, an unclosed element, a stray ampersand — and the same line is underlined in the editor.
Does it handle entities, CDATA, and namespaces?
Yes — parsing uses the browser's spec-compliant XML engine, so entities like & are decoded, CDATA sections become text, and namespaced tags keep their prefixes.
Can I get JSON out?
Yes. Switch the parsed pane to JSON for the converted structure, then Copy JSON or pick JSON (.json) from the Download menu.