JSON to XML

Convert JSON to XML and back with custom root, indent and attributes

How to Use

XML is still common in config files, SOAP services and legacy integrations, while modern code prefers JSON. This tool converts in both directions: JSON to XML walks the whole data tree recursively, object keys become child elements, arrays expand into repeated same-name elements, null values become empty elements and string values are escaped automatically so the output is always well-formed XML. XML to JSON uses the browser's built-in parser: repeated child elements are merged into arrays, childless nodes become text, numeric strings and booleans are restored to their types, and attributes are merged into the object with an @ prefix.

How to use: pick the direction; for JSON to XML you can set a custom root element name and the indentation width (2 spaces, 4 spaces or Tab). Paste your content, click "Convert" and copy the result in one click. Everything runs locally in your browser with no sign-up, so config or API data stays private.

FAQ

How are arrays represented in XML?

JSON arrays expand into repeated same-name elements, so an array under the key items becomes several items elements. Converting back, repeated sibling elements are merged into an array automatically.

Are XML attributes preserved after conversion?

Yes. Attributes are merged into the object with an @ prefix, so an id attribute becomes an @id key. When a node has both attributes and text, the text is stored under a #text key.

Does the conversion happen on a server?

No. Parsing and generation are done locally by your browser, nothing is uploaded and no sign-up is needed, which makes it safe for sensitive config and API data.