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.

