XML

XML Statistics and Structure Analyser

Counts elements by name, distinct attributes, text nodes and nesting depth so you can size a document before writing code against it.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste or load the document you want to measure.
  2. Select Analyse.
  3. Read the most frequent element name — that is almost always the record you want to iterate over.

What xml statistics does

Before you write a parser, a transform or an import against an XML file it helps to know its shape: which element carries the records, how many there are, how deep the nesting goes, and how many distinct names you are dealing with. This tool reports all of that from one pass over the document.

The element counts sorted by frequency usually give away the structure immediately. The name at the top is the record; a name that occurs exactly once is the root or a wrapper; and the depth figure tells you whether a straightforward flattening will work or whether you will lose information doing it.

Frequently asked questions

Sizing a job before you start it. The most frequent element name is usually the record, the depth tells you whether flattening will lose structure, and the distinct name count tells you how much mapping work a transform will be.

The document is parsed once and walked once, so the work grows in step with the file size rather than faster. Everything happens on the page thread, though, so a very large document will make the tab unresponsive while it runs — the limits shown on the page are set to keep that brief.

Yes. The root appears in the table with a count of one, which is a quick sanity check in itself: if a name you expected to be the root has a count above one, the document is not shaped the way you thought.