XML Viewer
Open an XML file as a collapsible tree, search elements, attributes and text, and copy the XPath of any element.
Drop an .xml, .svg, .rss, .kml, .xsd or .config file here, or paste below.
How local processing worksOpen a file, load the example, or paste XML into the source editor below.
Selected element
Select an element in the tree or a search result to see its XPath, attributes and text.
How to view an XML file
Open or paste the document. It is checked for well-formedness, then drawn as a tree with the first three levels open. The summary shows the root element, how many elements and attributes the file holds, and how deep it goes. Click any element to see its XPath, a table of its attributes and its child count, then copy the XPath or the element's text. Search matches element names, attribute names and values, and text, and clicking a match opens the tree down to it.
What the tree shows
Each row is one element, written as its start tag with attributes in source order. An element holding only text shows that text on the same row, so a record such as <price currency="USD">44.95</price> reads as one line. CDATA sections are shown with their markers so you can see the content was not parsed as XML, and comments stay where they appear in the document. Elements with more than 200 children open 200 at a time, which keeps a large feed or export responsive.
XML viewer options compared
Different tools suit different jobs, and a browser page is not always the right one.
| Input | Output | Note |
|---|---|---|
| Your browser's built-in view | Opening a .xml file directly in Chrome, Edge or Firefox shows a collapsible tree | Good for a quick look. No search by XPath, and files served as text/plain show as raw text. |
| XML Notepad (Microsoft, Windows) | Free desktop tree editor with XSD validation and XSLT | The better choice for editing and schema validation if you are on Windows. |
| A code editor (VS Code and similar) | Syntax highlighting, folding and, with extensions, XPath evaluation | Best when the file lives in a project you already have open. |
| This page | Tree, search and copy-XPath in any browser, with nothing installed | Read-only: it does not edit, validate against an XSD, or run XSLT. |
Common files people open here
RSS and Atom feeds, sitemap.xml files, SOAP requests and responses, Android layouts and manifests, Maven pom.xml and .NET .csproj or web.config files, SVG images, KML and GPX map tracks, and data exports from finance, government and e-commerce systems. If the next step is getting the data into code, XML to JSON converts it with the attribute and repeated-element rules shown on that page.
Frequently Asked Questions
How do I open an XML file in a readable format?
Click Open .xml file (or drop the file onto the page) and it is drawn as an indented tree: each element on its own row with its attributes, text shown inline, and every branch collapsible. Use Expand all to see the whole document, or search for a name or value to jump straight to it.
What XPath does Copy XPath give me?
An absolute location path from the root, such as /catalog/book[2]/price. A position in brackets is added only where an element name repeats among its siblings, and it counts from 1 as XPath does. Namespace prefixes are kept as written in the file (/s:Envelope/s:Body), so tools that evaluate XPath with namespaces need the same prefixes bound to the same URIs.
Does the viewer change or reformat my file?
No. It only reads it. Whitespace between elements is not drawn, and text is shown with leading and trailing whitespace trimmed, but the source editor keeps exactly what you opened. To rewrite the file with consistent indentation, use the XML Formatter.
Why does it say my XML is invalid?
The viewer runs the same well-formedness checks as the XML Validator before drawing anything: every tag closed and correctly nested, one root element, quoted attribute values, and no stray ampersands. The message gives the line and column of the first problem. A tree drawn from a broken file would show a structure the file does not have.
Which entities are decoded?
The five XML defines (& < > " ') and numeric character references such as é. HTML-only names such as are not XML entities unless the document's DTD declares them. Entities defined in terms of other entities are refused, because expanding them is how "billion laughs" files exhaust memory.
Is my data uploaded anywhere?
No. The conversion runs in JavaScript inside the page you already downloaded. There is no upload endpoint on this site, nothing is written into the URL, and closing the tab discards everything. Analytics record the tool name, whether the run succeeded, and a coarse size bucket — never the content.
Continue with the data, not the directory
Open a file and read its structure, without waiting for an editor to load the whole thing.
XML Formatter
Indent and beautify XML without rewriting your document - comments, CDATA, and attribute order are preserved.
XML Validator
Check XML well-formedness and get the exact line and column of the first error.
XML to JSON Converter
Convert XML to JSON instantly with our free online tool.
XPath Tester
Test XPath 1.0 expressions against XML locally with support for axes, predicates, unions, and core XPath functions.