1xA2ZOne Data. Any Format.
Live syncLocal-first · no data upload

Convert CSV to XML

Paste a CSV into the Quick paste box. Each line becomes an XML element and each column becomes a tag named after the header. Set the root and row tag names, then copy or download.

Runs entirely in your browser. Your data is never uploaded. Tiếng Việt

01

Spreadsheet

SheetsExcelCSVTSV
✦ Quick pasteSheets / Excel, CSV, TSV, Markdown, JSON, HTML, LaTeX, wiki…
0 rows · 0 columnsSelected cell: A1
02

Live Output

Markdowntwo-way
SyncedEdit directly; the table on the left updates itself
0 characters
Every change is processed right in your browserReady · LocalUTF-8 · by xuanhieu.org

When you need to convert CSV to XML

XML is still required by many accounting systems, internal importers and data exchange gateways, and a plain CSV is too bare for them. The real problem is tag names. A column header such as Start date contains a space, which an XML tag name cannot have, so the tool replaces spaces with underscores and the column becomes Start_date. The rest is choosing names that your receiver expects.

How to do it

  1. Paste the CSV into the Quick paste box and press Load into table ↵, or use Import file with a .csv file.
  2. Check the grid for the right column count. The header row will become tag names, so make headers meaningful right in the grid.
  3. Open the XML tab and ⚙ Options. Fill in the root tag name and the row tag name, and keep the header-as-tag option on if you want tags named after columns.
  4. Decide whether to keep the XML declaration line, depending on the receiver.
  5. Press Copy result or Download file to get the .xml file.

A real example

Each CSV line became a member element holding one child tag per header. The Start date column became Start_date: only the space changed, and the header row is no longer part of the data.

Input · CSV

Name,Team,Salary,Start date
Mai Tran,Design,2400,2024-03-01
Hugo Lee,Engineering,3200,2023-08-15
Nora Vo,Sales,2150,2025-01-06

Result · XML

<?xml version="1.0" encoding="UTF-8"?>
<staff>
  <member><Name>Mai Tran</Name><Team>Design</Team><Salary>2400</Salary><Start_date>2024-03-01</Start_date></member>
  <member><Name>Hugo Lee</Name><Team>Engineering</Team><Salary>3200</Salary><Start_date>2023-08-15</Start_date></member>
  <member><Name>Nora Vo</Name><Team>Sales</Team><Salary>2150</Salary><Start_date>2025-01-06</Start_date></member>
</staff>

Options worth changing

Use headers as tag names
On, each column becomes its own tag named after the header, which is readable and easy to map. Off, every row uses a generic cell tag and keeps the header row, which helps when headers cannot be used as tag names.
Root tag name
Name the element that wraps everything, for example staff. Use exactly the name the receiving system expects.
Row tag name
Name each record element, for example member. If you leave it empty the tool falls back to its default name.
<?xml?> declaration
Keep it when the receiver wants the version and UTF-8 encoding declared. Turn it off if you are pasting this XML inside a larger XML document.

Common problems

Limits

Frequently asked questions

What about accented column names?

Tag names keep their accents; only spaces turn into underscores. The system that receives the file must support UTF-8.

How do I keep the header row as data?

Turn off the header-as-tag option. The tool then uses a generic cell tag and keeps the header as a row.

Can I add attributes to the tags?

No. The tool writes child tags holding text and does not write attributes.

Can I convert XML back to CSV?

Yes, though attributes are ignored and nested tags are read as a block of text. See the XML to CSV page.

Does my data go anywhere?

No. Everything happens in your browser.

Related conversions

1xA2Z · Guide

Table statistics