TSV to XML

Turn tab-separated rows into XML.

0 chars
0 words
0 lines
0 chars
0 words
0 lines

TSV to XML Converter Online

The TSV to XML converter transforms tab-separated data into a well-formed XML document. It is built for the common situation where data lives in a spreadsheet or a tab-delimited export, but the receiving system — a content management system, a product feed, a SOAP service, or an XSLT stylesheet — expects XML.

From tabs to elements

Each line of the TSV becomes one row element, and each tab-separated value becomes a child element named after the matching header. With the sample customer list you get:

<records>
<record>
<id>1</id>
<name>Jane Doe</name>
...
</record>
</records>

Because only tabs split values, commas and quotes inside the data are plain text — Smith, John and Chloe "CJ" Martin arrive exactly as typed, with the quotes escaped as &quot; where needed.

Shape the output

  • Root element / Row element – match the vocabulary of your target schema, e.g. products and product.
  • Columns as attributes – produce compact rows like <record id="1" city="London"/>.
  • Indentation – spaces, tabs, or a single line for minimal size.
  • Normalize numbers & booleans – rewrite 1.50 as 1.5 and TRUE as true; off by default so values are copied verbatim.
  • XML declaration – include it for standalone files, drop it for fragments.

Tips for spreadsheet users

Select the cells in Excel or Google Sheets, copy, and paste here — the clipboard already holds TSV. Include the header row so the elements get meaningful names; otherwise turn off First row is a header and the columns become column1, column2… The table preview confirms how many columns were found on each line.

Check the result with the XML Validator or view it in the XML Viewer. For comma-separated input use CSV to XML; to go back to a table, try XML to TSV. Need JSON instead? TSV to JSON does that.

Frequently Asked Questions

A single root element (records by default) containing one row element (record) per TSV line. Each column becomes a child element named after its header, or an attribute of the row element when “Columns as attributes” is on.

Yes. Header names are converted into legal XML names: invalid characters become underscores and names starting with a digit get an underscore prefix, so “Order Date” turns into <Order_Date>. Cell values are escaped, so &, <, and quotes never break the document.

Yes. Switch off “XML declaration” when you are going to paste the output inside another XML document, where a second declaration would make it invalid.