Inspect structure without executing markup

Build, search, and expand an XML document tree

The worker parses the source, returns a bounded row model, and terminates. React displays every label and value as text; the XML is never injected into the page as HTML.

Loading the private XML tree viewer…

Enable JavaScript to explore XML locally. The node, namespace, and review guidance below remains readable.

Move from source text to a bounded outline

How to view and explore an XML tree

The tree is designed for orientation and focused inspection, not as a replacement for the source or a domain-aware XML editor.

  1. 1

    Paste one complete document

    Use XML 1.0 with a single document element. A failed structural parse produces a local diagnostic. If a DOCTYPE exists, the result visibly warns that its DTD grammar remains opaque.

  2. 2

    Build the text tree

    Elements become opening, empty, and closing rows; attributes, text, comments, CDATA, declarations, and processing instructions receive their own labeled rows.

  3. 3

    Search or collapse branches

    Filter by displayed names and values, or collapse an opening-element row to hide its descendants. Starting a search expands the outline and temporarily disables collapse controls; clear the search to return to the complete expanded outline.

XML is more than nested tags

What the XML viewer represents

XML's document model contains several node kinds. Elements establish hierarchy and carry qualified names. Attributes belong to elements but are not child elements. Text and CDATA sections carry character data. Comments and processing instructions can preserve author or application information. An XML declaration describes source-level properties but is not the document element.

The viewer creates rows that retain these distinctions instead of converting the document into a generic JavaScript object. Object conversions often lose ordering between text and elements, merge repeated sibling names into inconsistent shapes, or erase comments and processing instructions. A tree outline is closer to the parsed document structure, although it is still a presentation rather than the original bytes.

Opening elements with descendants can be collapsed. The search compares the visible row label and value case-insensitively and shows matching rows; it is not XPath, XQuery, CSS selection, full-text indexing, or namespace-aware query evaluation. Use a real query engine when selection semantics, axes, predicates, variables, or namespace bindings matter.

Element
A named structural node that can contain attributes and ordered child nodes.
Attribute
A named value attached to one element; its order is not application data.
Text
Character data whose whitespace can be significant to the consumer.
CDATA
A source notation for character data, not a separate application-level string type.

Prefixes are shorthand, URIs identify names

Reading XML namespaces in a tree view

Two identical local names can mean different things when their namespace names differ.

Default namespace

xmlns="https://example.com/invoice" sets the default namespace for unprefixed element names in scope. It does not automatically place unprefixed attributes in that namespace.

Prefixed names

In meta:updated, meta is a prefix bound by an in-scope xmlns:meta declaration. The prefix spelling can change while the expanded namespace name remains the same.

Shadowed bindings

A descendant can bind a prefix or default namespace differently from an ancestor. Read the closest in-scope declaration rather than assuming one prefix mapping applies to the entire file.

Search limitations

The viewer searches displayed row text; it does not resolve a query prefix to a namespace URI. Search can locate a QName or URI spelling, but namespace-aware selection belongs in XPath or application code.

Inspection is not rendering

Why this XML viewer displays rows as text

Some XML vocabularies, such as SVG or XHTML, can describe content a browser knows how to render. A developer inspection tool should not need to activate that content merely to show its structure. This viewer sends a plain row model from the worker and lets React create ordinary text nodes for labels and values. It does not use innerHTML for XML content.

Text-only display avoids turning an element name, event-like attribute, stylesheet instruction, link, or embedded markup into a live page node. The viewer also does not fetch stylesheets, schemas, DTD system identifiers, image sources, or linked documents. A DOCTYPE can appear as an opaque text row but is never fetched or validated; custom entity declarations and undefined named references are rejected.

This boundary is useful, but it is not a promise that every XML use is safe. If you pass the same document to a server parser with DTD loading enabled, an XSLT processor with extension functions, an SVG renderer, or an application with unsafe deserialization, that separate component has its own attack surface. Review the exact parser configuration at every trust boundary.

Need syntax or formatting?

Use the well-formedness checker for a focused syntax result. Use the formatter when the deliverable is an indented serialization that you can diff and download.

Open the XML Validator →
Open the XML Formatter →

A tree must stay bounded

Large XML documents, truncation, and statistics

Input and time

Input is capped at 200,000 UTF-16 code units and warned at 100,000; an astral Unicode symbol uses two units. Worker computation stops after two seconds to keep the tab responsive. A separate load timeout handles a worker that never becomes ready.

Depth and nodes

The parser layer limits nesting depth, element count, and attribute count. Those defensive bounds can reject a technically well-formed document that is too expensive for this interactive viewer.

Tree rows

The returned view is capped by row count and serialized output size. When truncation is reported, the outline is incomplete; do not infer that an absent row is absent from the source.

Structural totals

Statistics summarize the parsed document's root QName, elements, attributes, text nodes, comments, CDATA sections, processing instructions, depth, and distinct non-empty namespace URIs.

Tree behavior and boundaries

XML viewer FAQ

Does the XML viewer render markup as HTML?

No. Tree labels and values are rendered as React text. The viewer does not insert XML nodes into the page as HTML, run scripts, activate event attributes, apply XML stylesheets, or render SVG content.

What can I search in the XML tree?

The search filters rows by their displayed label and value, including element names, attribute names and values, text, comments, and CDATA represented in the tree. It is a case-insensitive text filter, not XPath or XQuery.

Does the XML tree prove that the document is well formed or valid?

No. XML 1.0 document structure and namespace constraints are checked, but a displayed DOCTYPE remains opaque, so the viewer does not establish that its internal subset is well formed. DTD grammar, XSD and other schemas, signatures, referenced identifiers, and application rules are not checked. See the XML validity guide.

Why are attributes separate rows?

Attributes belong to an element but are not child elements, and their ordering is not semantically significant in XML. Separate rows make the distinction and each name/value pair visible without pretending attributes are ordinary children.

What happens when the tree is truncated?

The page displays a warning. The returned outline reached a row or output-size limit and is incomplete. Reduce the source to the relevant subtree or use a streaming, indexed, or desktop tool designed for larger files.

Does collapsing a branch change the XML?

No. Collapse state only hides descendant rows in the current display. It does not edit the input, regenerate a document, or remove nodes from a downloaded file because the viewer has no edited-output action.