JSON to XML Converter
Convert JSON to XML and XML back to JSON.
Paste some JSON to convert.
How to use
- 1 Paste JSON, or basic XML, into the input panel.
- 2 Choose JSON → XML or XML → JSON.
- 3 For JSON → XML, optionally set the root element name.
- 4 Copy the converted output or download it as .xml / .json.
About JSON to XML Converter
The JSON to XML converter translates a JSON document into indented, readable XML and parses basic XML back into JSON.
It uses a deliberately simple and predictable mapping rather than a complex specification: each object key becomes a child element, nested objects recurse, arrays repeat the same element once per item, and primitive values become escaped text content.
The whole document is wrapped in a root element whose name you can set.
Going the other way, a leaf element becomes its text value, child elements become a nested object, and repeated sibling tags collapse into an array.
XML still powers SOAP services, RSS and Atom feeds, sitemaps, Office documents and a great deal of enterprise tooling, while JSON is the language of modern APIs.
Moving between them by hand means juggling angle brackets, escaping and indentation.
This tool handles the escaping of <, > and & for you and produces tidy, two-space-indented output that is easy to read or paste into a request.
The XML parser is intentionally basic — it ignores attributes and namespaces — so the mapping stays lossless and obvious for element-and-text documents.
Like every My Tools Garage tool it runs fully client-side, so payloads that may contain customer data or credentials are converted locally and never uploaded.
FAQ
How are arrays represented in XML?
An array repeats its element name once per item. For example {"item":[1,2]} becomes <item>1</item><item>2</item> inside the parent element.
Does it support XML attributes and namespaces?
No. The XML → JSON direction is a basic, lossless converter for element-and-text documents; attributes and namespaces are ignored to keep the mapping simple and predictable.
What happens to values after a round trip?
XML has no native types, so numbers and booleans come back as strings when converting XML → JSON. The structure is preserved exactly.