XML Viewer

Explore an XML document as a collapsible tree, with attributes shown inline and a count of children on every node.

XML
Tree view
Runs locally in your browser

About the XML Viewer

Reading a long XML file as text means scanning for matching close tags. The viewer parses the document and draws it as a tree: each element is a node showing its name and attributes, nodes with children can be expanded or collapsed, and elements that contain only text are shown on one line with their value. The first two levels open by default.

Because the tree comes from a real parse, the viewer is also a well-formedness check: a broken document produces a line-and-column error rather than a partial tree. The Copy button copies the formatted XML text, not the tree markup, so you can paste it into an editor.

It works for any XML dialect: SOAP envelopes, RSS and Atom feeds, SVG, Android layouts, Maven POM files, plist files, and sitemaps. For very large files, collapse deep branches rather than expanding everything, since every visible node is a DOM element.

How to use

  1. Paste XML on the left or upload a file.
  2. Click a node to expand or collapse it; the number after each node is how many children it has.
  3. Use Copy for the formatted text or Download to save it.

Common questions

Are attributes shown?
Yes, inline next to the element name in the form name="value".
Can I search inside the tree?
Use the browser find (Ctrl+F). Collapsed branches are not searchable until expanded, so expand the branches you care about first.
How do I query a value from the tree?
Open the same document in the XPath Tester and write an expression such as //book[@id="bk101"]/title.