HTML to XML: table data as records
HTML tables and XML documents look related, but they serve different purposes: a table describes how data is displayed, while XML describes what the data is. This html to xml converter reads the cells of a table and writes each row as a record element with one child per column, named after the column heading. The result is data you can feed to an XML import, transform with XSLT or query with XPath.
It is not an HTML-to-XHTML converter. Page structure, attributes and formatting are dropped on purpose; only the tabular content is kept.
Example: a parts list
<table>
<tr><th>Part no.</th><th>Unit price (USD)</th><th>Qty</th></tr>
<tr><td>X-1</td><td>4.20</td><td>10</td></tr>
<tr><td>Y-2</td><td>13</td><td></td></tr>
</table>
With Root element parts and Array item element part:
<?xml version="1.0" encoding="UTF-8"?>
<parts>
<part>
<Part_no.>X-1</Part_no.>
<Unit_price__USD_>4.2</Unit_price__USD_>
<Qty>10</Qty>
</part>
<part>
<Part_no.>Y-2</Part_no.>
<Unit_price__USD_>13</Unit_price__USD_>
<Qty/>
</part>
</parts>
How headings become element names
Column headings are rarely valid XML names, so each one is cleaned: spaces, parentheses and other symbols become underscores, while letters, digits, hyphens, periods and colons are kept. That is why Unit price (USD) turns into Unit_price__USD_. A heading that starts with a digit, or with the letters xml, gets a leading underscore. If you control the source table, short one-word headings produce the cleanest XML.
Headings that begin with the Attribute prefix (@ by default) become attributes of the row element instead of child elements, so a column titled @id yields <part id="…">.
Values, empty cells and types
With Detect numbers & booleans on, plain numbers are normalized before writing, so 4.20 appears as 4.2. Turn the option off to keep the exact cell text. Empty cells produce self-closing elements like <Qty/>. Characters such as & and < are escaped in the output.
Multiple tables
If the input contains several top-level tables, all of them go under the root element, and each row element is named after its table's id (or table1, table2 when there is none). The item name setting is used only for single-table input.
To check the result, run it through the XML validator or reformat it in the XML formatter. If you only need the data for code, HTML to JSON is usually simpler to work with.
Privacy
Everything runs in your browser. Load URL is fetched through our server, and Save & Share stores your input; nothing else leaves your device.