HTML Table to XML Converter
This HTML to XML converter takes a table from a page and produces well-formed XML: one element per row, with a child element named after each column heading. That last part needs care, because HTML table headings are free text and XML element names are not — a heading like "Order Total (USD)" or "2026 Forecast" would produce a document that fails to parse. Invalid characters are replaced with underscores and a leading digit gets an underscore prefix, so the output always parses. Cell markup is reduced to text, entities are decoded, and values are escaped on the way out so nothing in the data can break the document.
How it works
Turns a table on a page into well-formed XML: one element per row, with a child element per column named after its heading.
Headings that are not valid XML element names — ones with spaces or a leading digit — are rewritten with underscores, so the result always parses even though the source HTML did not have to.
The conversion runs entirely in your browser — nothing you paste or upload is sent to a server.
How to convert an HTML table to XML
- Paste the page source — or just the
<table>element — into the input on the left. - If the page has several tables, step through them with the table number box.
- Copy the result, or download it as a
.xmlfile.
Headings are the hard part
HTML table headings are free text. XML element names are not: they cannot contain spaces or most punctuation, and
they cannot begin with a digit. A heading like Order Total (USD) or 2026 Forecast is
perfectly ordinary in a table and would produce a document that fails to parse.
Rather than emitting broken XML, invalid characters become underscores and a leading digit gets an underscore prefix. The repair is predictable enough to map back to the original heading if you need to.
Escaping
Cell contents are reduced to text and entities are decoded on the way in, then re-escaped as XML entities on the
way out. That round trip is what stops a cell containing R&D or an HTML fragment from breaking
the document.
Naming the elements
The wrapper and row element names are both editable, so the output can match the schema you are feeding rather than forcing you to rename everything afterwards.
Common use cases
- Lifting a reference table out of documentation into something you can work with.
- Capturing a report from a web admin panel that has no export button.
- Turning a wiki table into data you can sort, filter or load.
Frequently asked questions
How do I convert an HTML table to XML?
Paste the page source or just the table element into the left panel. The XML document appears on the right, ready to copy or download.
What if a heading is not a valid XML name?
It is repaired. Spaces and punctuation become underscores and a leading digit gets an underscore prefix, because XML names cannot begin with a number.
Can I rename the wrapper and row elements?
Yes. Both are editable, so the output can match whatever schema you are feeding.
Is the data escaped?
Yes. Ampersands, angle brackets and quotes from the page are escaped as entities in the output.
What happens to markup inside a cell?
It is reduced to text before conversion, so a cell containing a link produces the link text as the element content.
Is anything transmitted?
No. The conversion is entirely local to your browser.
Related tools
HTML Table to JSON Converter
This HTML to JSON converter turns a table on a page into an array of typed objects.
HTML Table to CSV Converter
This HTML to CSV converter pulls a table off a page and gives you a spreadsheet file.
XML to JSON Converter
This XML to JSON converter parses XML into JSON online, preserving attributes and repeated tags as arrays.