Converters

XML to JSON

Convert XML data to JSON format.

Input XML
JSON result

XML to JSON Converter

Converts XML data to JSON format. Useful for modern API integration and JavaScript processing.

Features

  • Automatic structure parsing
  • Attribute handling
  • Formatted JSON output
  • Array detection

Use Cases

  • REST API integration
  • Frontend data processing
  • Configuration migration

Frequently Asked Questions

Where do XML attributes go in the JSON output?
This tool follows the widely used convention: attributes move into keys prefixed with @ ( becomes {"@id":"1"}), and text content goes under #text — the same convention as fast-xml-parser. Confirm which convention the target system expects, since libraries differ.
Why are all values strings after conversion?
XML has no number or boolean types — everything is text. Unless type inference is enabled (recognizing "123" as a number), values convert as strings. Add typing when wiring into strongly-typed APIs.
Why are keys so long with namespaced XML?
The tool keeps fully qualified names ( becomes "ns:item"), which is lossless. Stripping prefixes afterwards is fine for display, but merging blindly is risky: different prefixes may point to the same namespace.