XML Viewer
Paste an XML document, or a feed, SVG, or XHTML file, and walk it as a collapsible element tree instead of scrolling raw markup. Each node shows its tag name, its attributes as compact chips, and its text, comments, and CDATA, so the shape of the document is obvious. If the markup is not well-formed, the exact parser error is shown so you can find the unbalanced tag or stray ampersand. Nothing is uploaded — the document is parsed in your browser with the built-in XML parser, so API responses and config files stay on your machine.
How to use the XML Viewer
Paste XML into the box or load an .xml, .rss, .svg, .atom, or .xhtml file. The element tree renders as you type. Element names appear in colour, attributes are listed as name=value chips beside the tag, and text content, comments, and CDATA sections each get a distinct style so you can tell structure from data. Click any triangle to fold or unfold a branch, or use Expand all and Collapse all to operate on the whole tree.
Turn on Pretty source to swap the tree for a re-indented version of the raw markup, which is useful when a document arrived as a single minified line and you want to read or copy it with proper nesting. When the input is not well-formed, the tree is replaced by an error box quoting the parser's message, including the position of the fault, so a missing closing tag, a duplicated attribute, or an unescaped & is quick to locate. The viewer reads any namespace prefixes as part of the tag name, so namespaced documents such as SOAP envelopes or SVG display exactly as written.
What XML is and how it is structured
XML, the Extensible Markup Language, is a text format for representing tree-structured data using tags. Every document is built from elements, written as a start tag, optional content, and an end tag, such as <title>Hello</title>, or as a self-closing empty tag, <br/>. Elements nest to form a tree with exactly one root, and each can carry attributes, name-value pairs placed in the start tag like <item id="42">. Between tags sits character data: ordinary text, or a CDATA section, <![CDATA[ ... ]]>, which holds raw content such as code or markup without needing every special character escaped. Comments, <!-- ... -->, and a leading XML declaration round out the pieces.
A key distinction is between well-formed and valid. Well-formed means the document obeys XML's syntactic rules: one root element, every tag closed and correctly nested, attribute values quoted, and the five reserved characters escaped as entities (<, >, &, ", '). A parser rejects anything that is not well-formed, which is what this viewer reports. Validity is a stronger claim: that the document also conforms to a schema such as a DTD or XSD that defines which elements and attributes are allowed where. Namespaces add another layer, qualifying names with a prefix bound to a URI so that vocabularies from different sources can be mixed without collision.
Although JSON has displaced XML for many web APIs, XML remains everywhere it is hard to dislodge. RSS and Atom feeds are XML. SOAP web services wrap every message in an XML envelope. Configuration for large swathes of the Java and .NET worlds is XML, from Maven's pom.xml to web.config. SVG vector graphics are XML, and so is the inside of every modern Office document: a .docx or .xlsx is a ZIP archive full of XML parts. XML's verbosity is the usual complaint against it, but its mature tooling, schema validation, namespaces, and mixed-content support keep it the right choice for documents and contracts where structure must be explicit and checkable. A tree viewer is the fastest way to see that structure without parsing angle brackets by eye.
Common use cases
- Reading API and SOAP responses. Explore a deeply nested XML payload as a tree instead of scanning raw tags.
- Inspecting feeds. Browse the items and channel metadata inside an RSS or Atom feed.
- Debugging well-formedness. Find the unbalanced tag or unescaped character that makes a document fail to parse.
- Tidying minified XML. Re-indent a single-line document with the pretty-source toggle to make it readable.