I Help You

HTML Table → XML

Convert an HTML <table> to structured XML. Each row becomes a <row> element with child tags named after column headers. Tag names are sanitised to valid XML identifiers automatically. Free, and it runs entirely in your browser — nothing you enter is uploaded.

How to use the HTML Table → XML

1. Copy the <table>…</table> HTML from any webpage or HTML file.

2. Paste it into the input field on the left.

3. The structured XML appears instantly — copy it for use in data pipelines, SOAP services, or configuration systems that require XML input.

What is it?

XML remains the required data format for many enterprise systems, SOAP web services, EDI pipelines, and legacy integrations. When data is presented as an HTML table on a webpage, converting it directly to XML avoids manual re-entry and eliminates transcription errors.

The converter reads <th> elements as column headers (falling back to the first <td> row), then wraps each data row in a <row> element with child tags named after the headers. Column header names are sanitised to produce valid XML element names — spaces are replaced with underscores, leading digits are prefixed with an underscore, and other invalid characters are replaced.

Special characters in cell values (&, <, >, ", ') are automatically XML-escaped so the output is always well-formed and parseable by any standard XML processor.

Example

HTML Table
<table>
  <thead>
    <tr><th>Product</th><th>Price</th><th>In Stock</th></tr>
  </thead>
  <tbody>
    <tr><td>Wireless Mouse</td><td>$29.99</td><td>Yes</td></tr>
    <tr><td>USB-C Hub</td><td>$49.99</td><td>No</td></tr>
  </tbody>
</table>
↓
XML Output
<?xml version="1.0" encoding="UTF-8"?>
<table>
  <row>
    <Product>Wireless Mouse</Product>
    <Price>$29.99</Price>
    <In_Stock>Yes</In_Stock>
  </row>
  <row>
    <Product>USB-C Hub</Product>
    <Price>$49.99</Price>
    <In_Stock>No</In_Stock>
  </row>
</table>

Header "In Stock" becomes <In_Stock> — spaces are replaced with underscores to form valid XML element names.

Benefits

Share structured data with anyone, in any format

CSV output opens directly in Excel and Google Sheets; XML works with legacy enterprise systems; JSON feeds every modern API — convert to whatever format your audience needs.

Bridge incompatible data formats without a custom script

Convert between JSON, CSV, XML, and YAML in one click — the most common inter-system data translation handled instantly, without writing a parser or ETL pipeline.

Inspect, compare, and debug complex JSON structures

Sort, extract, compare, and measure JSON to find unexpected keys, spot structural differences between API versions, and diagnose oversized payloads.

Migrate legacy data to modern formats

Convert XML configs, PHP print_r() dumps, or CSV exports to clean JSON — without writing a one-off migration script that will never be used again.

Frequently asked questions

What happens to column headers with spaces or special characters?

Spaces are replaced with underscores, leading digits get a _ prefix, and other invalid XML name characters are replaced with underscores. For example, 'First Name' becomes <First_Name> and '2024 Revenue' becomes <_2024_Revenue>.

Are cell values XML-escaped automatically?

Yes. Ampersands (&), angle brackets (<, >), and quotes are automatically escaped in the output so the XML is always well-formed and parseable by any XML processor.

What is the root element and row element called?

The root element is <table> and each data row is wrapped in a <row> element. Child tags are named after the column headers (after sanitisation).

Is my data sent to a server?

No. All processing happens entirely in your browser using JavaScript. Your data never leaves your device.