Skip to main content

Code & Data

XML and JSON converter

Convert XML to JSON and back with a documented mapping: attributes as "@name", text as "#text", repeated siblings as arrays.

  1. 1Fill in the values
  2. 2Click Run
  3. 3See results instantly

Limits

  • Mapping: attributes become "@name", text "#text", repeated siblings an array, empty elements "" (or null). Namespace prefixes stay as written and are not resolved.
  • All values are strings; numbers and booleans are not guessed. A one-item array comes back as a plain value.
  • Mixed content keeps the text but not its position between elements; comments, processing instructions and DOCTYPE are dropped (comments can be kept).
  • Different siblings that interleave (a, b, a) are regrouped (a, a, b). DTD entity declarations are refused. Limit 5 MB.

Ask the AI chat

The AI chat can run this tool for you. Try:

  • “convert xml to json”
  • “json to xml”
  • “xml json converter”