XML Converter
Convert XML to JSON, YAML, CSV, TSV, or HTML table. Paste any XML and choose your output format instantly in the browser.
Last updated: May 28, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is XML Converter?
XML (Extensible Markup Language) is a versatile data format used in enterprise systems, APIs, configuration files, and data feeds. While XML is powerful, most modern tools and workflows prefer JSON, YAML, or tabular formats like CSV.
This XML converter handles the most common conversion targets from a single page: JSON (for APIs and JavaScript), YAML (for configuration and DevOps), CSV (for spreadsheets and databases), TSV (for tab-separated imports), and HTML table (for display and reporting). Simply paste your XML, choose the output format, and the conversion happens instantly in your browser.
How to Use XML Converter
Paste your XML into the input area on the left
Select the output format: JSON, YAML, CSV, TSV, or HTML
For JSON and YAML, toggle "Include Attributes" to control whether XML attributes appear in the output
For CSV/TSV/HTML, the tool flattens the XML children of the root element into rows — best for list-like XML
Click "Copy" to copy the result or "Download" to save it
Common Use Cases
- Converting XML API responses to JSON for use in JavaScript applications
- Converting XML configuration files to YAML for Kubernetes or Docker Compose
- Exporting XML data feeds to CSV for Excel or database import
- Converting XML reports to HTML tables for display in web pages
- Transforming XML product catalogues or RSS feeds to tabular data
- Quickly checking the JSON equivalent of an XML response during API debugging
Example Input and Output
An XML product list converted to JSON:
<?xml version="1.0"?>
<products>
<product id="101">
<name>Mechanical Keyboard</name>
<price>89.99</price>
<inStock>true</inStock>
</product>
<product id="102">
<name>USB-C Hub</name>
<price>34.99</price>
<inStock>false</inStock>
</product>
</products>{
"products": {
"product": [
{ "@id": "101", "name": "Mechanical Keyboard", "price": "89.99", "inStock": "true" },
{ "@id": "102", "name": "USB-C Hub", "price": "34.99", "inStock": "false" }
]
}
}How This Tool Works
XML is parsed with the browser's native DOMParser. For JSON and YAML, a recursive DOM walker converts elements to nested objects. Attributes become @-prefixed keys; repeated sibling elements become arrays. For CSV/TSV/HTML, the tool flattens the root's direct children into row objects. js-yaml serialises YAML output; built-in string formatting handles CSV, TSV, and HTML.
Technical Stack
Privacy First
XML conversion runs entirely in your browser. Your XML data is never transmitted to our servers.
Tabular XML Tip
CSV, TSV, and HTML table output works best when each child of the root element is a record with consistent sub-elements. If your XML is deeply nested or irregular, use JSON or YAML output instead for a complete representation.
Frequently Asked Questions
Which formats can I convert XML to?
You can convert XML to JSON (default), YAML, CSV, TSV, and HTML table. JSON and YAML preserve the full hierarchical structure including nested elements. CSV, TSV, and HTML table flatten the direct children of the root element into rows — this works best for list-like XML where all records share the same element structure.
How does CSV/TSV conversion work for XML?
For CSV/TSV/HTML output, the tool looks at the direct children of the root element and treats each child as a row. The columns are the sub-elements and attributes of those children. This works best for XML that resembles a table (e.g., <products><product>...</product></products>). Deeply nested or irregular XML may not produce meaningful tabular output.
What happens to XML attributes in the output?
For JSON and YAML output, attributes are included by default as keys prefixed with @ (e.g., id="101" becomes "@id": "101"). You can toggle attribute inclusion off for a cleaner output. For CSV/TSV/HTML, attributes of each row element are included as columns alongside child elements.
Can I use this for SOAP or RSS XML?
Yes. For SOAP responses, the JSON output will include the full envelope structure including namespaced elements. For RSS/Atom feeds, JSON or YAML output will capture the channel title, items, links, and other fields. If you specifically work with SOAP, try the dedicated SOAP to JSON tool which strips the envelope automatically.
Is my XML data sent to a server?
No. All conversion happens in your browser using the native DOMParser for XML parsing and js-yaml for YAML output. Your XML is never transmitted to our servers.
Related Tools
XML to JSON Converter
Parse and convert XML to clean JSON instantly — attributes, namespaces, and nested elements handled.
XML to YAML Converter
Convert XML to YAML. Parses XML with the browser DOMParser, maps element names to YAML keys, handles attributes (@prefix), and serializes repeating siblings as YAML sequences.
XML to CSV Converter
Convert XML to CSV online. Flattens repeated XML elements into rows and columns with configurable quoting and header options.
XML Beautifier
Format and prettify minified or messy XML with configurable indentation. Also minify XML to remove whitespace.
JSON Formatter
Format, validate, and beautify JSON instantly — with clear error messages, Tree View, Diff mode, and Schema validation.
YAML Beautifier
Format and prettify YAML with configurable indentation and optional key sorting. Validates YAML syntax instantly.

