HTML to XML
Convert an HTML table into XML.
HTML Table to XML Converter Online
The HTML to XML converter transforms an HTML <table> into clean, well-formed XML with one element per row. HTML tables are meant for display, while XML is meant for exchange — converting between them lets you feed web-published data into XSLT stylesheets, ERP imports, Office documents, or any system that validates XML input.
Output structure
<rows><row><Plan>Starter</Plan><vCPU>1</vCPU></row></rows>
Rename rows and row to something meaningful such as plans / plan. With Columns as attributes, every cell becomes an attribute of the row element instead. Indentation can be 2 or 4 spaces, tabs, or a single line, and the XML declaration is optional.
Extraction details
- All tables are found – paste an entire page source and pick the table by its number in the document. Nested tables are counted as separate tables and their text is kept out of the outer cell.
- Headers – Auto takes the header from
<thead>or an all-<th>first row; First row forces it; No header names the elementscolumn1,column2… - Spans –
colspanfills the covered columns with empty elements androwspanrepeats the value in the following rows, so every row has the same children. - Text and entities – inline tags are stripped,
and other named or numeric entities are decoded, then special characters are re-escaped correctly for XML (&,<).
A preview of the extracted table appears under the editors so you can confirm the right table was picked before downloading.
Typical uses
Migrating product specs from an old CMS into a PIM that imports XML, turning a published exchange-rate or timetable table into a feed for a batch job, or preparing test data for an XSLT report are all one paste away. The conversion runs in your browser, so internal pages can be processed without uploading them anywhere.
Related tools
Check or explore the result with the XML Viewer or XPath Tester, transform it with XML XSL Transform, or convert the same table to JSON, CSV, or YAML.
Frequently Asked Questions
How are column headers turned into XML names?
Each header becomes a child element (or an attribute) name. Characters that are not allowed in XML names are replaced with underscores, so “Price / month” becomes Price___month, and names starting with a digit get a leading underscore.
Elements or attributes — which should I pick?
Elements (the default) are easier to extend and read. Switch on “Columns as attributes” for a compact one-line-per-row format like <row Plan="Starter" vCPU="1"/>, which many import tools and XPath queries handle nicely.
Does the caption of the table end up in the XML?
No. The caption is shown in the preview to help you identify the table, but the XML contains only the header names and cell values. Rename the root element to describe the data instead.