CSV to XML Converter Online — Free & Private

CSV is parsed to a JSON array and then serialized with the same rules as JSON to XML. You can predict the root and item names from the shape of your table.

Loading…
CSV → XML for batch exports to legacy systems
Turns CSV extracts from an ERP into XML payloads for systems that expect XML.

Developer notes

A flat array produces repeated `_item` elements, as in the JSON → XML documentation. Validate the result against your partner’s XSD offline.

Use cases

EDI-style pipelines that still expect XML envelopes. Handoffs between teams when analysts only work with CSV.

About these options

For CSV output, choose the delimiter, how fields are quoted, the line endings and whether to write a header row. Auto uses a comma in English and a semicolon in French, German and Spanish, as Excel expects. For CSV input, the delimiter is detected on the first line (comma, semicolon, tab or pipe). You choose whether that line holds the column names. JSON output can use 2 or 4 spaces or a single line, with an optional recursive key sort. XML output can be pretty-printed with a chosen indent width. YAML output takes an indent width and a quoting mode for strings. XML comments are dropped, because the conversion goes through a JSON tree.

Examples

Product table

Input

sku,name,qty,price WB-001,Wireless Ergonomic Mouse,120,24.99 WB-002,USB-C Hub Pro Adapter,85,49.50 WB-003,Mechanical Keyboard RGB,42,89.00 WB-004,Adjustable Monitor Stand,67,35.25

Output

<?xml version="1.0" encoding="UTF-8"?> <roo_item> <sku>WB-001</sku> <name>Wireless Ergonomic Mouse</name> <qty>120</qty> <price>24.99</price> </roo_item> <roo_item> <sku>WB-002</sku> <name>USB-C Hub Pro Adapter</name> <qty>85</qty> <price>49.50</price> </roo_item> <roo_item> <sku>WB-003</sku> <name>Mechanical Keyboard RGB</name> <qty>42</qty> <price>89.00</price> </roo_item> <roo_item> <sku>WB-004</sku> <name>Adjustable Monitor Stand</name> <qty>67</qty> <price>35.25</price> </roo_item>

Semicolon-delimited file

Input

id;city;country 1;Paris;FR 2;Berlin;DE 3;Madrid;ES 4;Rome;IT

Output

<?xml version="1.0" encoding="UTF-8"?> <roo_item> <id>1</id> <city>Paris</city> <country>FR</country> </roo_item> <roo_item> <id>2</id> <city>Berlin</city> <country>DE</country> </roo_item> <roo_item> <id>3</id> <city>Madrid</city> <country>ES</country> </roo_item> <roo_item> <id>4</id> <city>Rome</city> <country>IT</country> </roo_item>

Related tools

Convert to JSON first with CSV → JSON, then check it with the JSON validator or browse it in the JSON tree viewer. You can also export through JSON → YAML and JSON → CSV.

CSV → XML FAQ

Markup details

Namespaces?

They are not added. Add the wrappers by hand after the export.

Attributes?

Only what JSON → XML produces today.

Huge CSV?

Parsing is synchronous, so split large inputs into chunks.

Different XML root?

Reshape the JSON before the XML step: convert to JSON, edit it, then convert to XML.

Convert CSV to JSON, XML, YAML, TOML and TSV.