XML structure analyzer

Helps you understand an unfamiliar XML file before converting it or writing code to read it.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter xml text.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

The document is parsed and every element is visited with its path from the root, such as /catalog/book. For each path the count is tallied and attribute names collected. Depth starts at 1 for the root, and only text nodes with a non-space character are counted.

Example

Result: Elements: 9; Distinct element names: 5; Attributes: 4.

Limits and caveats

  • The paths table lists the first 400 paths only in very large documents.
  • It does not infer data types or generate an XSD schema.

Questions about this tool

What is the paths table for?

It shows every place an element appears and how often, so you can spot the repeating element to use as rows when converting to CSV.

How is depth counted?

The root is depth 1 and each nesting level adds 1, so catalog, book, title in the example gives depth 3.

Are comments counted as elements?

No, only tags are elements. Comments and processing instructions are not part of any count.