Developer Tools

XML to JSON Converter

Convert XML data to JSON format instantly. Perfect for API development and data migration.

Example XML Input

<root>
  <user id="1">
    <name>John</name>
    <email>john@example.com</email>
  </user>
</root>

JSON Output

{
  "root": {
    "user": {
      "@id": "1",
      "name": "John",
      "email": "john@example.com"
    }
  }
}

Frequently Asked Questions

How are XML attributes handled?

XML attributes are prefixed with "@" in the JSON output. For example, <user id="1"> becomes {"@id": "1"}.

Does it handle nested elements?

Yes! Nested XML elements are converted to nested JSON objects, preserving the full hierarchy.

What about repeated elements?

Multiple elements with the same name are converted to JSON arrays automatically.

Related Tools