CSV to XML
Turn each row of a CSV file into an XML element. Nothing is uploaded.
Drop CSV files here
Converted on your device. Files are never uploaded.
Up to 20 files at a time.
Some import tools, feeds and older systems want XML rather than a spreadsheet export. FormatJet reads your CSV, detects its separator and writes each row as an item element with one child per column, inside a root element. The whole conversion runs in your browser, so the data never leaves your device.
About the formats
CSVCSV file
CSV stores a table as plain text, one row per line with commas between the values. Spreadsheets, databases and almost every data tool can read and write it.
XMLXML file
XML stores data as nested, named elements with attributes. Feeds, office files, invoices and older web services use it.
Converted with Data converters (Papa Parse, yaml, fast-xml-parser), Data converters on Workers.
Questions
What does the XML look like?
Each CSV row becomes an <item> element with one child element per column, all inside a <root> element, written as indented UTF-8 with an XML declaration.
What if my column headers contain spaces?
XML element names can’t contain spaces, so they’re replaced with underscores and “Order date” becomes Order_date. A header starting with a digit gets an underscore in front.
Does a semicolon-separated CSV work?
Yes. FormatJet works out whether your file uses commas, semicolons, tabs or another separator, and handles quoted values that run over several lines.
What about blank or duplicate column names?
Unnamed columns get the names column_1, column_2 and so on, and a second column with the same name becomes name_2, so every element name is valid and distinct.
Which text encodings can the CSV use?
UTF-8, with or without a byte order mark, or UTF-16 with one. If accented letters come out wrong, save the file again as “CSV UTF-8” in Excel.
CSV to XML with the API
The conversion API opens later this year.
curl https://api.formatjet.com/v1/convert?to=xml \
-H "Authorization: Bearer fj_test_…" \
-F file=@input.csv -o output.xml