XML to HTML table converter
Useful for reviewing a large XML file at a glance or publishing its contents as a table on a web page.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter xml text and repeating element name (optional).
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
The record element is chosen as in the XML to CSV converter: the most repeated element with attributes or children, or the name you type. Attributes become @name columns, children columns by name, deeper fields path columns. The table is written with thead and tbody and escaped cells.
Example
Result: HTML table: <table> <thead> <tr> <th>@id</th> <th>@lang</th> <th>title</th> <th>author</th> <th>price</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>ar</td> <td>مقدمة ابن خلدون</td> <td>ابن خلدون</td> <td>45</td> </tr> <tr> <td>2</td> <td>en</td> <td>Arabian Sands</td> <td>Wilfred Thesiger</td> <td>60</td> </tr> </tbody> </table>; Record element: book; Rows: 2.
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<book id="1" lang="ar">
<title>مقدمة ابن خلدون</title>
<author>ابن خلدون</author>
<price>45</price>
</book>
<book id="2" lang="en">
<title>Arabian Sands</title>
<author>Wilfred Thesiger</author>
<price>60</price>
</book>
</catalog><table>
<thead>
<tr>
<th>@id</th>
<th>@lang</th>
<th>title</th>
<th>author</th>
<th>price</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>ar</td>
<td>مقدمة ابن خلدون</td>
<td>ابن خلدون</td>
<td>45</td>
</tr>
<tr>
<td>2</td>
<td>en</td>
<td>Arabian Sands</td>
<td>Wilfred Thesiger</td>
<td>60</td>
</tr>
</tbody>
</table>Limits and caveats
- Auto detection can miss in complex files, type the repeating element name in that case.
- The preview shows the first 400 rows only, the markup contains every row.
Questions about this tool
How do I choose what becomes a row?
Type its name in the repeating element box, such as book or item, otherwise the most repeated element is used.
How do nested elements appear?
They become path columns, so city inside address shows up in an address/city column.
Can I export the table to Excel?
Use the XML to CSV converter for a file Excel opens directly, it applies the same column rules.
