RealJSON
Try now

XML to JSON Converter

Paste XML and get clean, structured JSON. Handles attributes, namespaces, and auto-groups repeated tags into arrays.

XML to JSON Converter — Transform XML Documents Instantly

XML was once the dominant format for web services and configuration. Today, JSON has largely replaced it — but legacy systems, enterprise APIs, and SOAP services still produce XML. RealJSON's free XML to JSON converter handles the translation cleanly, running entirely in your browser.

Paste any XML document and click Convert. The output is a structured JSON object that faithfully represents the original XML hierarchy — no manual reformatting required.

Intelligent XML to JSON Conversion

Attribute Handling

XML attributes like <user id="1"> are preserved in the JSON output as properties alongside element content — no information is lost during conversion.

Namespace Support

XML namespaces are handled gracefully, with namespace prefixes preserved in the JSON keys so you can trace the source of each property. Useful for SOAP responses and enterprise XML schemas.

Repeated Tag Grouping

In XML, repeated sibling elements like <item> in a list are automatically grouped into a JSON array. This is the correct behavior for representing collections and avoids the common pitfall where a single-item list isn't treated as an array.

Why Convert XML to JSON?

  • Work with legacy API data using modern JavaScript, Python, or Go tooling
  • Feed XML-sourced data into a JSON-based processing pipeline
  • Reduce XML parsing boilerplate in your applications
  • Store or display configuration data in a more readable JSON format

Related Tools

After converting, use the JSON Viewer to explore the output structure visually, or the JSON Formatter to indent it neatly. If you're working with tabular data instead, the CSV to JSON converter handles spreadsheet exports.

Browse all free JSON tools →