Go to Sign up
Note: Your files never leave your device. We don't upload, transfer, or store your data.
|
|
|
|
|---|---|---|
|
|
|
XML (eXtensible Markup Language) is a markup language defined by the W3C for encoding documents in a human-readable, machine-readable format. It uses tags to define structure and meaning.
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<book id="1">
<title>The Great Gatsby</title>
<author>F. Scott Fitzgerald</author>
<price>10.99</price>
</book>
<book id="2">
<title>1984</title>
<author>George Orwell</author>
<price>8.99</price>
</book>
</catalog>
| Concept | Syntax | Description |
|---|---|---|
| Declaration | <?xml version="1.0"?> | Optional header specifying XML version and encoding |
| Root element | <root>...</root> | Single top-level container for all data |
| Child elements | <name>Alice</name> | Nested elements with text content |
| Attributes | <row id="1"> | Name-value pairs within opening tags |
| Self-closing | <empty/> | Elements with no content |
| CDATA | <![CDATA[...]]> | Unparsed character data (preserves special characters) |
| Comments | <!-- comment --> | Non-rendered annotations |
| Use Case | Description |
|---|---|
| Data interchange | Exchange data between systems that require XML (SOAP, RSS, Atom) |
| Configuration files | Generate XML config files from CSV data |
| Legacy system import | Feed CSV data into systems that only accept XML |
| RSS feeds | Convert product catalogs to RSS/XML feed format |
| SOAP services | Create XML payloads for SOAP web services |
| Android resources | Generate XML string/adapter resources from CSV |
| SVG data | Create SVG-compatible data structures |
| Microsoft Office | Excel, Word, and PowerPoint use XML-based formats |
| Sitemap generation | Convert URL lists to XML sitemaps |
| Publishing | XML is standard in publishing workflows (DocBook, DITA) |
This tool offers two output modes:
Data values appear as child elements:
<root>
<row>
<name>Alice</name>
<age>30</age>
<city>New York</city>
</row>
</root>
Data values appear as attributes on the row element:
<root>
<row name="Alice" age="30" city="New York"/>
</root>
| Mode | Best For |
|---|---|
| Elements | Complex data, long text values, data that may contain special characters |
| Attributes | Simple key-value pairs, IDs, short metadata, compact output |
W3C recommendation: Use elements for data, attributes for metadata.
After loading CSV data, an interactive spreadsheet grid lets you edit before converting:
| Operation | Description |
|---|---|
| Transpose | Swap rows and columns |
| Clear | Remove all data |
| Delete Empty | Remove empty rows/columns |
| Deduplicate | Remove duplicate rows |
| Replace | Find and replace (with regex support) |
| Case transform | UPPERCASE, lowercase, Title Case |
| Insert/delete | Right-click for row/column operations |
| First Row as Header | Toggle header treatment |
Converts XML-reserved characters to entities:
| Character | Entity |
|---|---|
< | < |
> | > |
& | & |
" | " |
' | ' |
Without escaping (invalid XML):
<description>Price < 100 & > 50</description>With escaping (valid XML):
<description>Price < 100 & > 50</description>Always enable this when data may contain <, >, &, ", or '.
Removes whitespace, indentation, and line breaks:
Regular:
<root>
<row>
<name>Alice</name>
</row>
</root>
Minified:
<root><row><name>Alice</name></row></root>Use minified for production (smaller file size). Use regular for development and debugging.
Adds the XML declaration header:
<?xml version="1.0" encoding="UTF-8"?>The declaration is recommended for all XML documents. It tells parsers the XML version and character encoding. Disable only when embedding XML fragments into larger documents.
Wraps text content in CDATA sections to preserve special characters without escaping:
With CDATA:
<description><![CDATA[Price < 100 & > 50]]></description>Without CDATA (with escaping):
<description>Price < 100 & > 50</description>CDATA preserves the original text exactly. Use when:
Data contains HTML or markup
Data contains many special characters
You want the output to remain human-readable
Content includes code snippets or formulas
| Option | When to Use |
|---|---|
| 2 spaces | Default — clean, compact |
| 4 spaces | Deeply nested XML |
| 8 spaces | Very deep nesting |
| Tabs | Match project conventions |
Sets the character encoding in the XML declaration. Default: UTF-8.
| Encoding | When to Use |
|---|---|
UTF-8 | Default — supports all Unicode characters |
ISO-8859-1 | Legacy Western European systems |
Windows-1252 | Legacy Windows systems |
UTF-16 | Systems requiring wide character encoding |
Sets the name of the top-level XML element:
<catalog> <!-- Root Element = "catalog" -->
<row>...</row>
</catalog>
Common choices: data, catalog, records, results, feed.
Sets the name of each row-level XML element:
<data>
<book>...</book> <!-- Row Element = "book" -->
<book>...</book>
</data>
Common choices: row, record, item, book, product, user, entry.
All processing runs entirely in your browser. No data is uploaded to any server.
Choose one of two input methods:
Upload a file: Click "Choose File" and select a .csv file.
Paste data: Click "Enter Data" to switch to the code editor. Paste your CSV.
The data loads into an interactive grid. Use the toolbar to:
Transpose, deduplicate, delete empty rows
Find/replace values
Transform text case
Insert/delete rows and columns
Use the Properties panel:
Escape XML Characters: Enable for data containing <, >, &
Minify Output: Enable for compact production output
XML Declaration: Enable to add <?xml version="1.0"?>
Attribute Mode: Enable for attributes; disable for child elements
CDATA Wrapper: Enable to preserve special characters as-is
Indent Size: Choose formatting
Encoding: Set character encoding (default: UTF-8)
Root Element: Enter root tag name (e.g., catalog)
Row Element: Enter row tag name (e.g., book)
Click Convert. The XML appears in the "Output Data" panel.
Click Copy to Clipboard to paste into your .xml file.
Premium users can click Download File to save.
Input CSV:
title,author,price,year
The Great Gatsby,F. Scott Fitzgerald,10.99,1925
1984,George Orwell,8.99,1949
To Kill a Mockingbird,Harper Lee,12.99,1960
Configuration:
Escape XML: On
XML Declaration: On
Attribute Mode: Off (elements)
CDATA: Off
Indent: 2 spaces
Root Element: catalog
Row Element: book
Output:
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<book>
<title>The Great Gatsby</title>
<author>F. Scott Fitzgerald</author>
<price>10.99</price>
<year>1925</year>
</book>
<book>
<title>1984</title>
<author>George Orwell</author>
<price>8.99</price>
<year>1949</year>
</book>
<book>
<title>To Kill a Mockingbird</title>
<author>Harper Lee</author>
<price>12.99</price>
<year>1960</year>
</book>
</catalog>
Same input CSV.
Configuration: Attribute Mode: On, Root: employees, Row: employee
Output:
<?xml version="1.0" encoding="UTF-8"?>
<employees>
<employee title="The Great Gatsby" author="F. Scott Fitzgerald" price="10.99" year="1925"/>
<employee title="1984" author="George Orwell" price="8.99" year="1949"/>
<employee title="To Kill a Mockingbird" author="Harper Lee" price="12.99" year="1960"/>
</employees>
Input CSV:
name,description
Widget A,Contains <b>bold</b> text & special chars
Widget B,Price is < $100 for "premium" items
Configuration: CDATA: On
Output:
<?xml version="1.0" encoding="UTF-8"?>
<data>
<row>
<name>Widget A</name>
<description><![CDATA[Contains <b>bold</b> text & special chars]]></description>
</row>
<row>
<name>Widget B</name>
<description><![CDATA[Price is < $100 for "premium" items]]></description>
</row>
</data>
Configuration: Minify: On, XML Declaration: On
Output:
<?xml version="1.0" encoding="UTF-8"?><data><row><name>Alice</name><age>30</age></row></data>For XML to be valid, it must be well-formed:
| Rule | Description |
|---|---|
| Single root | Exactly one top-level element |
| Proper nesting | All elements properly closed in correct order |
| Matching tags | Every <tag> has a matching </tag> |
| Attribute quoting | All attribute values in single or double quotes |
No < in content | Must be escaped as < or wrapped in CDATA |
No & in content | Must be escaped as & or wrapped in CDATA |
| Valid names | Element names start with letter or underscore |
| XML declaration | If present, must be first line |
This tool generates well-formed XML by default.
No. All conversion happens locally in your browser using JavaScript. Your data never leaves your device.
Element Mode outputs data as child elements (<name>Alice</name>). Attribute Mode outputs data as attributes (<row name="Alice"/>). Use elements for data content; use attributes for metadata and IDs.
CDATA (Character Data) is a section in XML that tells the parser to treat content as plain text without interpreting special characters. Use <![CDATA[...]]> to preserve HTML, code, or text with <, >, & characters.
Yes, for standalone XML documents. The declaration (<?xml version="1.0"?>) tells parsers the XML version and encoding. Omit only when embedding XML fragments into larger documents.
Use UTF-8 unless you have a specific requirement. UTF-8 supports all Unicode characters and is the default for modern XML documents.
Root Element is the top-level container tag (e.g., <catalog>). Row Element is the tag for each data row (e.g., <book>). Choose names that describe your data.
Yes. The built-in table editor lets you modify cells, transpose, deduplicate, find/replace, change case, and insert/delete rows and columns before generating XML.
Standard CSV with comma delimiters. The first row can be used as column headers (enable "First Row as Header").
The tool processes data entirely in your browser. Files up to 10 MB typically convert without issues on modern hardware.