HTML table to XML converter
Move table data from a web page into a system that imports XML without retyping it.
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 html containing a table, table number on the page, root element name and row element name.
- 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 table is read by the built-in HTML reader (entities decoded, spanned cells repeated). The first row gives the tag names after fixing invalid ones, a blank header becomes column_N and a repeat gets a _2 suffix. Each later row becomes an element, with &, < and > escaped.
Example
Inputs: Table number on the page = 1, Root element name = rows, Row element name = row. Result: XML: <?xml version="1.0" encoding="UTF-8"?> <rows> <row> <المنتج>قهوة عربية</المنتج> <السعر>45</السعر> <الكمية>3</الكمية> </row> <row> <المنتج>تمر سكري</المنتج> <السعر>30</السعر> <الكمية>5</الكمية> </row> </rows>; Tables found: 1; Rows: 2.
<table> <tr><th>المنتج</th><th>السعر</th><th>الكمية</th></tr> <tr><td>قهوة عربية</td><td>45</td><td>3</td></tr> <tr><td>تمر سكري</td><td>30</td><td>5</td></tr> </table>
<?xml version="1.0" encoding="UTF-8"?>
<rows>
<row>
<المنتج>قهوة عربية</المنتج>
<السعر>45</السعر>
<الكمية>3</الكمية>
</row>
<row>
<المنتج>تمر سكري</المنتج>
<السعر>30</السعر>
<الكمية>5</الكمية>
</row>
</rows>Limits and caveats
- The first row must hold the column headers.
- Values are written as text, numbers and dates are not reformatted.
Questions about this tool
What if the page has several tables?
Enter the table number by its order in the code, the first is 1, and the tool shows how many tables it found.
Can I change the tag names?
Yes, the root and row names come from the input boxes, and the column tags come from the table headers.
How does an empty cell look?
As a short empty tag such as <column_2/>, which equals an open and close tag with nothing inside.
