XML Viewer

Check XML is well-formed, format it and explore it as a tree or table with XPath search and CSV export. A free online XML viewer that runs in your browser.

About XML Viewer

This XML viewer checks, formats and explores XML documents in your browser. Paste a feed, a config file or an API response, or open an .xml file, and you can read it as an indented tree, as formatted text or, for repeating records, as a table you can export.

It uses the browser's own XML parser, which never fetches external DTDs or entities, and nothing you load is uploaded or saved. Large documents work too; above 20 MB the viewer simply warns that searching and expanding may slow down, since all the work happens on your device.

How to use

  1. Paste XML, drop or open an .xml file, or load the sample document.
  2. If the XML isn't well-formed, read the error with its line, column and the offending line, and fix it in the source.
  3. Format the document with 2 spaces, 4 spaces or tabs, or minify it.
  4. Explore it in the Tree, Text or Table view, find text, or run an XPath query.
  5. Copy a node's path or value, copy the XML, or download it formatted or minified.

Features

Well-formedness check
Broken XML is reported with the line and column of the problem and an excerpt of that line, so mismatched tags and stray characters are quick to find.
Tree view
Expand and collapse elements to see attributes, text, CDATA sections and comments in context, with Expand all and Collapse all for big documents.
Formatter and minifier
Re-indent messy XML with 2 spaces, 4 spaces or tabs, or strip the whitespace for the smallest file, then copy or download either version.
Find and XPath search
Find element names, attributes and text, stepping through matches with Enter and Shift+Enter, or switch to XPath mode to select nodes with an expression.
Table from repeating elements
Pick a repeating element, such as each item in a feed, to see the records as rows, then jump from any row back to it in the tree.
Export to CSV
Export the table, or just the filtered rows, as a CSV file, or copy it as CSV, TSV or a Markdown table.
Copy paths
Copy the path to any node, such as /catalog/book[2]/title, ready to use in code or as an XPath expression, or copy its value.

Frequently asked questions

Does it validate XML against a schema?

No. It checks that the document is well-formed, meaning tags are properly nested and closed, attributes are quoted and there is one root element. Validating against an XSD or DTD schema isn't supported.

Is my XML uploaded anywhere?

No. Parsing, formatting and searching all run in your browser, and the document is never sent to a server or kept after you close the page. External DTDs and entities referenced in the file are not fetched either.

Why does my XPath query return nothing?

The most common cause is a default namespace (xmlns="..." on the root element). XPath then won't match plain element names; the viewer points this out and can suggest an expression using local-name() instead.

How do I convert XML to CSV?

Switch to the Table view, choose the repeating element that represents one record, and select Export CSV. Each child element or attribute becomes a column.

Can it open large XML files?

Yes, within your computer's memory. Files over 20 MB open with a notice, because expanding and searching a big tree in the browser takes longer.