XML Tools
XML Viewer — Tree & Code View
Explore any XML document as an interactive tree — elements, attributes (@-prefixed), and counts at a glance.
In short
View XML online in a collapsible tree or syntax-highlighted code view. Explore elements, attributes, and nesting at a glance — free, fast, no upload.
By NaveenKumar T · Updated
- Collapsible element tree
- Attributes shown as @keys
- Expand / collapse all
Runs entirely in your browser — nothing you paste or open here is uploaded, logged, or stored.How we handle data →
Example
XML Viewer: input and output
A two-book catalog fragment — small enough to read in Code view, structured enough to show what the Tree view groups together.
<?xml version="1.0" encoding="UTF-8"?><catalog><book id="bk101"><title>Learning YAML</title><author>Grace Hopper</author><price>24.99</price></book><book id="bk102"><title>XML in Practice</title><author>Ada Lovelace</author><price>19.5</price></book></catalog><?xml version="1.0" encoding="UTF-8"?>
<catalog>
<book id="bk101">
<title>Learning YAML</title>
<author>Grace Hopper</author>
<price>24.99</price>
</book>
<book id="bk102">
<title>XML in Practice</title>
<author>Ada Lovelace</author>
<price>19.5</price>
</book>
</catalog>The two <book> elements, each with a different id attribute, sit side by side here in Code view — switch to Tree view in the workbench and they group under a single <book> branch with a 2-item count.
Learn more
Reading XML as a tree
XML's verbosity makes raw markup hard to scan: every piece of data is wrapped in opening and closing tags. The tree view strips the ceremony and shows the structure itself — element names as branches, attributes and text as leaves, sibling counts on every node — so a 5,000-line document becomes a dozen collapsible branches.
The viewer parses with a real XML parser, so what you see is exactly what an application consuming the document would see, including type-like details such as repeated elements forming lists.
| Node type | Shown as | Example |
|---|---|---|
| Element | A branch, named after the tag | book |
| Attribute | An @-prefixed leaf under its element | @id |
| Text content | The element's value, or a #text leaf when mixed with children | #text |
| Repeated siblings | One branch with an item count | book (×2) |
| Empty element | A branch with an empty string value | note: "" |
Workflows the viewer accelerates
Inspecting SOAP responses without counting angle brackets, verifying a generated sitemap or feed has the structure you intended, exploring an unfamiliar API's payloads, and answering 'how many items does this export actually contain?' — the counts on each branch answer it instantly. When the tree is a data export, XML to JSON turns it into something a script can consume.
Help
Frequently asked questions
Everything you need to know about the XML Viewer.
01How do I use the XML Viewer?
Paste your XML or drop a file on the editor — the document opens directly in Tree view with every element foldable. Switch to Code for the formatted markup, or use Expand/Collapse all for big documents.
02How are attributes and text shown in the tree?
Attributes appear as @-prefixed keys (@id, @href) under their element, and an element's text content appears as its value (or under #text when mixed with children). Repeated sibling elements group into an array-like list with an item count.
03Can the viewer open large XML files?
Multi-megabyte documents load; the practical limit is your device's memory rather than any quota. The tree view is the expensive part — rendering tens of thousands of expandable nodes costs more than displaying the text — so for very large exports open the file in Code view, use Collapse all, and expand only the branches you need.
04Can I search inside the tree?
There's no dedicated search box for the tree itself — that JSONPath-style filter bar is a JSON-input feature. For XML, switch to Code view and use your browser's own find (Ctrl/⌘+F), or use Collapse all and navigate branches by name once the structure is visible.
Keep working
Related tools
XML Formatter
XML Tools
XML Parser
XML Tools
XML Diff
Two XML documents side by side with markup highlighting, so an attribute edit reads differently from a text-node edit at a glance.
XML Editor
XML Tools
XML to JSON
Parse any XML document into clean JSON — repeated elements become arrays, attributes preserved, text nodes kept.
JSON Viewer
Explore any JSON document in an interactive, collapsible tree — keys, types, and counts at a glance, with code view one click away.