XML Parser

Parse XML and browse each element, attribute, text and comment as labeled tree nodes.

Add XML and click Parse XML to see the tree here.

How XML Parser works

Parses XML and shows every node as a labeled tree: elements, attributes, text, CDATA sections, comments, processing instructions and the doctype. It is a good way to see how a program reads your XML.

A summary line counts the elements, attributes, text nodes and other nodes, and gives the depth of the document. The XML version, encoding and every namespace with its prefix are listed above the tree.

Input to XML Parser

  • Paste or type XML into the input box, or upload a .xml or .txt file. Click Parse XML to run it.
  • Input must be well formed XML. If it is not, you see the line and column of the first error.
  • Entity declarations (<!ENTITY>) are blocked to keep you safe.

Output from XML Parser

  • A tree where the first 3 levels start open. Use Open all and Close all to change that, or click any element to open or close it.
  • Spaces and line breaks between tags are left out, since they are only layout.
  • Click Show code to see the tree as JSON. Copy it or download it as a .json file.
  • Very large XML shows the first 5,000 nodes in the tree. The JSON has all of them.