How to open and view an XML file
- Open an .xml file, drop it onto the text box, paste XML or load it from a URL. If the XML is broken, the viewer shows the line and column of the error.
- Browse the tree: click an element to expand or collapse it, or use Expand all and Collapse all. Type in the search box to find names, attributes and text.
- Select a node and click Copy XPath to copy its path or Copy node to copy its XML.
What the tree shows
| Node type | Example |
|---|---|
| Element | <product id="p1"> and the number of its child nodes |
| Attribute | id="p1" |
| Text | Wireless mouse |
| CDATA section | <![CDATA[a < b]]> |
| Comment | <!-- prices in EUR --> |
| Processing instruction | <?xml-stylesheet href="style.xsl"?> |
Long lists of sibling nodes are loaded in batches, so files of several megabytes stay responsive.
How to open an XML file on your computer
An .xml file is plain text, so any text editor can open it: Notepad on Windows, TextEdit on a Mac or a code editor such as VS Code. Chrome and Firefox show XML files as a basic tree when you drag them into a browser window. This viewer adds search, folding and XPath copying, decodes UTF-8, UTF-16 and the encoding named in the XML declaration, and points to the exact line and column if the file is broken.
Frequently asked questions
Is my XML file uploaded?
No. Files you open or paste are read and displayed in your browser and never sent to a server. Only when you load a URL is that public address fetched through our server.
Why is my file not shown as a tree?
The tree needs well-formed XML. An unclosed tag, an unescaped & or a second root element stops the parser, and the viewer shows where. Fix the line in the XML editor or check the file with the XML validator.
Can I open XML from a URL?
Yes, if the file is publicly reachable. It is fetched through our server, because most websites do not let browsers read their files directly. Files behind a login have to be downloaded and opened from your computer.
Which files can I view?
Any XML-based text file, for example sitemaps, RSS and Atom feeds, SVG images, XSD schemas, XSLT stylesheets, .config files and e-invoices.