FormatterHQ

XML to TSV Converter

Get tab-separated rows from XML records. TSV pastes straight into spreadsheet cells, and commas inside values need no quoting.

Input XML
Output TSV
Ready.

How to use the XML to TSV Converter

  1. Paste XML into the input editor, upload a file, use Load URL, or click Sample.
  2. Set the Attribute prefix and choose Include header row and Flatten nested objects.
  3. Click Convert to TSV.
  4. Click Copy and paste into a spreadsheet, or Download the file.

Why convert XML to TSV instead of CSV

An XML to TSV conversion produces the same rows and columns as CSV, but separates values with tab characters. That small difference has a practical benefit: when you copy tab-separated text and paste it into Excel, Google Sheets or Numbers, each value lands in its own cell immediately, without an import dialog. Commas in names, addresses and prices do not need quotes, because the comma is not the separator.

Example

<catalog>
  <book id="bk101"><author>Gambardella, Matthew</author><price>44.95</price></book>
  <book id="bk102"><author>Ralls, Kim</author><price>5.95</price></book>
</catalog>

Output (tabs shown as wide gaps):

@id	author	price
bk101	Gambardella, Matthew	44.95
bk102	Ralls, Kim	5.95

Compare this with CSV, where both author names would need to be wrapped in quotes. TSV is also the format many command-line tools and database bulk loaders read by default, which makes it a convenient intermediate step for data pulled out of XML exports.

How rows and columns are built

Each repeated record element, <book> here, becomes one row. Attributes become columns with the attribute prefix (@id); clear the prefix field for plain names. Nested elements become dot-notation columns such as address.city when Flatten nested objects is on, or JSON text in a single cell when it is off. Include header row controls whether the first line lists the column names.

When quoting still happens

TSV has one weak spot: values that themselves contain a tab or a line break. Those are wrapped in double quotes so the row structure stays intact, and most spreadsheet apps read them correctly. In XML data this mostly affects multi-line descriptions. If you plan to process the file with simple line-based tools like cut or awk, check such fields first.

Loading the TSV into other tools

Tab-separated output is read by many data tools with little or no configuration:

-- MySQL: tab is the default field separator
LOAD DATA LOCAL INFILE 'books.tsv' INTO TABLE books IGNORE 1 LINES;

-- PostgreSQL: CSV mode with a tab delimiter also handles quoted values
\copy books FROM 'books.tsv' WITH (FORMAT csv, DELIMITER E'\t', HEADER true)

# Python with pandas
df = pd.read_csv("books.tsv", sep="\t")

# Shell: print the author column
cut -f2 books.tsv

Using PostgreSQL's CSV mode rather than its plain text format matters here, because it understands the double quotes that the converter adds around values containing tabs or line breaks. Keep Include header row on whenever the loader can skip or use a header, so the column names travel with the data.

Picking the right sibling tool

  • XML to CSV – when an importer requires CSV or you need a semicolon or pipe delimiter.
  • XML to Excel – when you want a real .xlsx file with a named sheet.
  • XML to HTML table – when the data should appear on a web page.

Privacy

The conversion runs locally in your browser. Only Load URL and Save & Share involve our server.

Frequently asked questions

How do I paste the TSV into Excel?
Click Copy in the output panel, select the top-left cell in Excel and paste. Tabs move each value into its own column and each line becomes a row.
What is the difference between TSV and CSV?
Only the separator. CSV uses commas, TSV uses tab characters. TSV rarely needs quoting because tabs seldom appear in data, which makes it convenient for copy and paste.
Can I choose a different delimiter here?
No, TSV always uses tabs. Use the XML to CSV converter for comma, semicolon or pipe delimiters.
Why do some values have quotes around them?
They contain a tab or a line break. Quoting keeps such a value in one cell instead of breaking the row.

Last updated October 3, 2026

Related tools