XML Viewer
Explore XML as a collapsible tree instead of a flat block of text.
Paste XML on the left to explore it.
What is XML Viewer?
XML Viewer turns a block of XML into an interactive, expandable tree instead of a flat wall of angle brackets — the same way a browser's built-in JSON or XML viewer works, but for any XML you paste in. Each element becomes a node you can collapse or expand, its attributes show up as small tags next to it, and leaf elements show their text content directly. This is a different tool from XML Formatter (which pretty-prints or minifies XML as text): XML Viewer is for exploring the structure of a document you don't already know well — a large API response, a config file, an RSS feed — without scrolling through hundreds of lines of reformatted markup.
How to Use XML Viewer
- Paste your XML into the box on the left.
- The tree on the right updates instantly as you type or paste.
- Click the chevron next to any element to expand or collapse its children.
- Attributes appear as small tags right after the element name; leaf elements show their text content inline.
- If the XML is malformed, an error message explains what's wrong instead of showing a broken tree.
Examples
Exploring a small catalog document
Input: <catalog><book id="1"><title>Dune</title></book></catalog>
Output: A collapsible <catalog> node containing one <book id="1"> node, which expands to reveal a <title> leaf showing "Dune"
Malformed input
Input: <root><unclosed></root>
Output: A clear error message instead of a broken or empty tree
Common Mistakes
- Pasting HTML instead of XML — HTML tolerates unclosed tags like <br> and <img> that XML's parser treats as errors.
- Expecting schema/DTD validation — this tool only checks well-formedness, not whether the document matches an expected structure.
- Not noticing the collapse arrows on deeply nested documents and assuming the tree is incomplete when it's just collapsed by default past a couple of levels.
- Pasting a document with multiple root-level elements — XML requires exactly one root element; wrap siblings in a common parent first.
Why Use This Tool
- Turns unfamiliar or deeply nested XML into something you can actually navigate, rather than scroll through.
- Processes entirely client-side — nothing you paste leaves your browser.
- Clear, specific error messages when the XML isn't well-formed, instead of a silent blank result.
- No size or complexity limit beyond what your browser can comfortably render.