JSON ↔ XML converter
Convert JSON into well-formed XML with a custom root element, or turn an XML document back into clean JSON — attributes, nested elements, and repeated tags all round-trip correctly.
A JSON ↔ XML converter that preserves structure
Attributes, nested elements, and repeated tags all round-trip correctly — no manual cleanup needed on either side.
@attributes object in JSON, and back again, so nothing from the original document is lost.Frequently asked questions
How do I set the root XML element name?
Use the "Root element" field above the JSON → XML button. It defaults to root, but you can set it to anything valid, like catalog or response, before converting.
What happens to JSON arrays when converting to XML?
Each item in an array is written as a repeated <item> element inside its parent, since XML doesn't have a native array concept. Converting back to JSON collects repeated sibling elements with the same tag name back into an array automatically.
Are XML attributes supported when converting XML to JSON?
Yes. Element attributes are captured under an @attributes key on the corresponding JSON object, and text content alongside attributes is captured under #text, so no information from the original XML is lost.
Does this tool validate my XML?
It uses the browser's built-in XML parser, so malformed XML (unclosed tags, mismatched elements) will show a clear parsing error instead of silently producing bad JSON.