Convert CSV to XML
Custom tags,
any structure.
Free CSV to XML converter with full control over output structure. Custom root and row tag names, element mode, attribute mode or mixed. Pretty print, XML declaration, copy to clipboard. Runs entirely in your browser.
Three steps to structured XML from any CSV file.
Drop your .csv file. CSVShift reads the headers and pre-fills the root and row element names from the filename. A file named products.csv auto-suggests <products> as root and <product> as the row element.
Enter your root and row element names, choose the XML structure (element, attribute or mixed mode) and whether to include the XML declaration. All CSV column headers are automatically sanitized into valid XML tag names.
Preview the first 25 lines of output to verify the structure, then download the .xml file or copy it to your clipboard. All values are correctly escaped for XML — &, <, > and quotes are handled automatically.
Choose the right structure for your target system or API.
<products>
<product>
<name>Widget</name>
<price>9.99</price>
<qty>100</qty>
</product>
</products>
<products>
<product
name="Widget"
price="9.99"
qty="100"/>
<product
name="Gadget"
price="19.99"
qty="50"/>
</products>
<products>
<product name="Widget">
<price>9.99</price>
<qty>100</qty>
</product>
</products>
(1st col = id attr)
XML is the right format when your target system requires it.
XML (eXtensible Markup Language) is a structured data format that uses custom tags to describe data hierarchically. Unlike CSV — which is flat and untyped — XML carries semantic meaning in its tag names and supports nested structures, attributes and namespaces. It remains the dominant format for enterprise integrations, SOAP web services, EDI transactions and configuration files.
Convert CSV to XML when your target system requires it: ERP integrations (SAP, Oracle), e-commerce product feeds (Google Shopping, Amazon), document management systems, government data submissions or any SOAP API. The element, attribute and mixed modes in CSVShift cover the three structural patterns used by virtually all XML-consuming systems.
Real workflows where XML output is required.
Google Shopping, Amazon and comparison shopping engines accept product catalog data as XML feeds. Converting your product CSV to XML with the correct tag structure produces a feed that uploads directly to these platforms.
SAP, Oracle and most enterprise systems use XML as their data exchange format. Converting a CSV export from one system to XML allows import into another without a custom middleware integration.
Legacy SOAP APIs accept XML-formatted request bodies. Converting a batch of CSV records to XML produces the payload structure needed to make bulk API calls without manually constructing each XML document.
Some applications read configuration or reference data from XML files. Converting a CSV lookup table to XML produces the file format the application expects, with the tag names you specify matching the schema it reads.
What each setting produces in the output XML.
| Option | Values | What it produces |
|---|---|---|
| Root element name | Any valid XML name | The outermost XML element that wraps all rows. Pre-filled from your filename. Use names like products, customers, transactions. Must start with a letter or underscore and contain no spaces. |
| Row element name | Any valid XML name | The element that wraps each CSV row. Typically the singular form of the root: product, customer, transaction. Column header names are used as child element or attribute names. |
| XML structure | Elements · Attributes · Mixed | Element mode creates a child element per column — safest for long values and special characters. Attribute mode produces compact single-tag rows — common in configuration files. Mixed uses the first column as an ID attribute and the rest as child elements — matches many enterprise XML schemas. |
| XML declaration | Include · Exclude | Adds <?xml version="1.0" encoding="UTF-8"?> as the first line. Required by some parsers; omit when embedding XML in a larger document or when the receiving system adds its own declaration. |
| Formatting | Pretty · Minified | Pretty adds newlines and 2-space indentation — human-readable and easy to validate. Minified removes all unnecessary whitespace — smaller file size, required by some XML parsers that are sensitive to whitespace in text nodes. |
Other free converters on CSVShift you might need.
XML generated in
your browser. Always.
CSVShift builds the entire XML output in JavaScript in your browser. Your CSV data is never sent to any server. All character escaping — ampersands, angle brackets, quotes — is handled correctly following the XML 1.0 specification, ensuring valid output that passes XML validation.
Column headers that contain characters invalid in XML tag names (spaces, numbers at start, special characters) are automatically sanitized — spaces become underscores, numeric prefixes get an underscore added — without breaking the overall structure.
<row><name>Alice</name><age>32</age></row>. Attribute mode puts all values as attributes on one tag: <row name="Alice" age="32"/>. Element mode handles long values and special characters better; attribute mode produces more compact output.rss and row tag item, then add the channel wrapper and namespace declarations manually. For full Google Shopping XML, consider the dedicated feed generator tools in Google Merchant Center.