CSV to XML Converter
Convert CSV to XML online. Paste or drop a CSV/TSV file and get well-formed XML with custom root and row elements, nested tags and typed values. Free, private, in your browser.
π Runs entirely in your browser β nothing is uploadedConvert CSV files to XML in seconds
CSV is the universal export format of spreadsheets, databases and CRMs, but a lot of software still wants XML: SOAP and legacy enterprise APIs, ERP and accounting imports, product feeds for marketplaces, e-invoicing formats, Android resources and many configuration systems. This CSV to XML converter turns a table into a well-formed, indented XML document directly in your browser. Paste the data, drop a .csv or .tsv file, or load the sample to see how it works.
The first row is treated as the header. Each following row becomes one row element inside a single root element, and each column becomes a child element named after its header. Values are escaped correctly, so ampersands, angle brackets and quotes inside cells never break the document. Quoted fields that contain commas or line breaks are parsed according to RFC 4180, the same rules Excel and Google Sheets use when they export CSV.
Root element, row element and nesting
Rename the root (for example products) and the row element (for example product) to match the schema your receiver expects. Header names that are not legal XML names β ones with spaces, symbols or a leading digit β are sanitized automatically. Turn on Nest dotted headers to build hierarchy from a flat sheet: columns like address.street and address.city are grouped under one <address> element. Keep Detect numbers & booleans on to write clean values; leading-zero codes such as ZIP codes and very long IDs are kept exactly as text.
Tips for clean XML output
XML has no built-in types, so validate the result against the XSD your system uses. Remove the <?xml?> declaration when you paste a fragment into another document, and pick tabs or four-space indentation to match your codebase. For further work, format or inspect the result with the XML formatter, convert it back with XML to JSON, or try the sibling converters CSV to JSON, CSV to YAML and CSV to TOON. Everything runs locally, which makes the tool safe for customer lists, price lists and other confidential spreadsheets.
How to use
- Add your CSVPaste CSV or TSV text, drop a .csv file, or click Load sample. The delimiter is detected automatically.
- Name the elementsSet the root element and the row element, choose indentation and whether to include the XML declaration.
- Copy or download the XMLCopy the generated XML or download it as a .xml file.
Frequently asked questions
How is each CSV row converted to XML?
<row>) inside the root element, and every column becomes a child element named after its header, e.g. <email>[email protected]</email>.What happens to headers with spaces or that start with a digit?
Can I create nested XML from a flat CSV?
address.city becomes <address><city>β¦</city></address>.