XML Converter

Convert between XML and JSON formats, or format and beautify XML documents.

XML Input

0 characters
Lines: 1 | Size: 0 bytes

JSON Output

XML & JSON Conversion Guide

XML to JSON
Converts XML elements to JSON objects, attributes to @attributes
JSON to XML
Converts JSON objects to XML elements, arrays to repeated elements
XML Formatting
Beautifies XML with proper indentation and line breaks
Attributes
XML attributes are converted to @attributes object in JSON
Data Types
XML has only text, JSON supports strings, numbers, booleans, null
Arrays
JSON arrays become repeated XML elements with same name
Namespaces
XML namespaces are preserved but may not convert perfectly
Use Cases
API integration, data migration, configuration conversion
XML Example:
<user id="123">
  <name>John Doe</name>
  <active>true</active>
</user>
JSON Equivalent:
{
  "user": {
    "@attributes": {
      "id": "123"
    },
    "name": "John Doe",
    "active": "true"
  }
}