SiteTidy
Home /Tools /XML to JSON

XML to JSON Converter

Instantly convert XML documents and payloads into structured JSON data.

Input XML

Output JSON

Why Convert XML to JSON?

XML (eXtensible Markup Language) was the standard for data exchange for many years, especially with SOAP APIs. However, modern web development heavily favors JSON (JavaScript Object Notation) due to its lighter weight, native JavaScript support, and readability.

This tool provides a standard transformation, converting XML elements to JSON objects, XML attributes to the @attributes key, and grouping repeating child nodes into JSON arrays automatically.

Features

  • Attribute Support: Attributes on XML tags are correctly grouped under an @attributes object property.
  • Array Detection: Multiple sibling nodes with the same name are automatically grouped into a single JSON array.
  • CDATA Handling: Properly extracts and parses CDATA text nodes as standard strings.
  • Custom Formatting: Output your JSON nicely formatted with 2 or 4 spaces, or output minified JSON.

Privacy Note

Your data is fully secure. Since all XML parsing and JSON generation is performed via client-side JavaScript, your data never leaves your device.

Related Guides

Deepen your understanding with our expert articles.