TSV to XML
Convert a table into XML, one element per row. You choose the root and row element names, and whether the header supplies child-element names or attribute names. Values are XML-escaped, and header names that aren't valid element names are sanitised — a column called Total (USD) can't be a tag as written, and an invalid name produces a document nothing will parse.
How to use
- Paste or drop the TSV.
- Set the root element (the wrapper, e.g.
rows) and the row element (repeated per record, e.g.row). - Choose how the header is used — as child element names, or as attributes on the row element.
- Copy or download as
.xml.
Elements or attributes
Child elements are the safer default: they can hold any text, including newlines, and they're what most XML consumers expect for data fields. Attributes make a more compact document and are conventional for identifiers and metadata, but they can't contain a newline cleanly and they can't repeat.
If your header names contain spaces, punctuation, or start with a digit, they're rewritten into valid XML names. That's a silent change to your column names, so check the first record of the output against the header you started with.
What XML gets you
Mostly interoperability with systems that predate JSON: SOAP services, enterprise imports, publishing pipelines, some government and banking formats. It also gives you schema validation (XSD) and real escaping, which TSV lacks entirely. If you have a choice, JSON or JSONL is smaller and easier to consume. The reverse direction is XML → TSV.
FAQ
Is there an XML declaration at the top?
Yes — <?xml version="1.0" encoding="UTF-8"?>, since a consumer that assumes Latin-1 will mangle non-ASCII text without it.
Can I produce nested elements?
No — the structure is root, then one flat element per row. Nesting requires knowing which columns group together, which a flat table doesn't express.
What happens to special characters?
&, <, >, and quotes become entities, so the document stays well-formed whatever the data contains.
Can it validate against my XSD?
No. Generate the document here and validate it with xmllint --schema or your editor's XML tooling.
Privacy
100% client-side. No upload. See the privacy policy.