Paste XML, open a file or press Sample, and the tree appears here.
Paste XML to see its repeated elements as a table.
Selected node
Select a row in the tree to see its XPath, line, attributes and text.
View XML as a collapsible tree, search it with XPath, or read it as a table.
Paste XML, open a file or press Sample, and the tree appears here.
Paste XML to see its repeated elements as a table.
Select a row in the tree to see its XPath, line, attributes and text.
An XML viewer shows an XML file as a tree you can open and close, one element per row.
Our viewer builds that tree as you type or open a file. It shows the parts of the file in their original order, including text between elements, comments, CDATA sections and processing instructions, and it never changes the XML.
Select any row to see its XPath, line number, attributes and text, or switch to Table to read repeated elements as rows.
&, < and character references like © appear as the characters they stand for, and CDATA text appears exactly as written./catalog/product[2]/name that points to that element and no other.Each row in the XML tree stands for one part of the file.
| Row | What it is |
|---|---|
<product id="p-101"> | An element with its attributes. An arrow in front means it has children. |
<name> Mechanical Keyboard | An element that holds only text, shown on one row |
| Plain text | Text between elements, such as the words around a bold tag |
| CDATA | A CDATA section, text the parser doesn't read as markup |
<!-- ... --> | A comment |
<?xml ... ?> | The XML declaration, or a processing instruction |
Switch the search to XPath and type an expression in XPath 1.0, the query language for XML. Matching elements are highlighted, and an expression that returns a number, a string or true or false shows its result.
| XPath | What it finds in the sample |
|---|---|
//product | All 3 product elements |
//product[@status='active']/name | The names of the 2 active products |
//product[price > 50]/name | The names of the 2 products priced over 50 |
count(//product) | The number 3 |
//*[local-name()='image'] | The media:image element, whatever its namespace |
If the root element has an xmlns="..." attribute, its elements are in that namespace, and a plain name like //url matches none of them. Write //*[local-name()='url'] instead, the same way the viewer writes its own XPaths.
The XML Viewer reports each of these mistakes with its line and column.
&. The status box names the line and column of the first one.<?xml ...?> is an error. The XML declaration must be the very first thing in the file. Delete anything before it, even a space.<Item> closed by </item> is an error. The message names the line where the open element starts.People use an XML viewer whenever an XML file is too long or too nested to read as text.
To indent the XML itself, use the XML Formatter. To turn it into JSON, use the XML to JSON Converter, and for a web page, use the HTML Viewer, which renders the page instead of showing its tree.
Click Open file and pick it, or drop the file on the XML box. Any text editor opens XML too, but only as plain text.
View it as a tree in our viewer, where each element gets its own row. For indented source text instead, use the XML Formatter.
No, the XML is read and parsed on your device. Nothing is sent to a server.
Yes, files of several megabytes work, because long lists show 200 rows at a time. Search and XPath still cover every node.
Yes, CDATA sections, comments and processing instructions all appear in the tree in their original order. CDATA text is shown exactly as written.
Yes, the Table tab shows repeated elements, such as every <product>, as rows. Each attribute and child element gets a column, and you can copy or download the table as CSV.
PHPSecure Login System with PHP and MySQL
PHPShopping Cart System with PHP and MySQL
JavaScriptMulti Select Dropdown with HTML and JavaScript
JavaScript5 Ways to Detect Mobile Devices with JavaScript
PHPImplement Google Login with PHP
PHPEvent Calendar with PHP
PHPSecure Registration System with PHP and MySQL
PHPHow to Send Emails in PHP with Gmail SMTPTop categories
More categories
By language
Collections
Web references
Lookups