100% client-side · no sign-up

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.

Root element
JSON
XML
Ready Lines: 0 Characters: 0
Drag & drop a .json or .xml file onto either panel

A JSON ↔ XML converter that preserves structure

Attributes, nested elements, and repeated tags all round-trip correctly — no manual cleanup needed on either side.

🏷️
Custom root element
Set the root element name to match whatever your target system expects, instead of a hardcoded default.
🔧
Attributes preserved
XML attributes map to an @attributes object in JSON, and back again, so nothing from the original document is lost.
📋
Repeated tags → arrays
Sibling elements sharing a tag name automatically become a JSON array, matching how most APIs model lists in XML.
🔒
100% client-side
Parsing and conversion happen entirely in your browser tab. Your data is never uploaded, logged, or stored on a server.

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.

More JSON tools