XML to JSON Converter
Turn an XML document into JSON, with attributes and text content preserved.
Convert JSON into well-formed XML.
XML has no arrays, so each entry becomes a repeated element.
JSON to XML Converter rewrites a JSON document as XML. It is most often needed when a modern service produces JSON and an older system, a SOAP endpoint or an enterprise import routine insists on XML.
The two formats do not map perfectly onto one another, so the conversion makes some decisions and tells you what they are. JSON object keys become element names. Values become element text. Arrays become repeated sibling elements, named after the key where that produces a valid name, because XML has no array type of its own.
Names are the sharp edge. XML element names cannot start with a digit, cannot contain spaces, and cannot be empty, while JSON keys can be any string at all. Keys that would produce invalid names are rewritten predictably and the change is reported, so you are never handed XML that silently will not parse.
Escaping is handled throughout: ampersands, angle brackets and quotes in values are turned into entities, so text containing markup does not break the document. The output is indented and ends up parsing cleanly in any XML reader.
Everything runs inside your browser. Nothing you paste is uploaded, logged or stored, which matters when the input is a client list, an internal URL map or anything else you would not post publicly.
The json to xml converter is used by writers, developers, students, marketers and anyone else who needs the job done once without installing software. Common cases include:
As repeated sibling elements sharing the key's name, because XML has no array type. A key called items holding three values produces three item elements inside an items element.
They are rewritten to something valid, with invalid characters replaced and a leading letter added where a name began with a digit. Every change is listed, so nothing happens behind your back.
Yes, a standard UTF-8 declaration at the top, which is what most parsers expect.
No. Everything becomes an element, because JSON has no way to distinguish an attribute from a child value. If you need attributes, the usual convention is to post-process the result.
Yes. Ampersands, angle brackets and quotes are escaped as entities, so values containing markup do not break the document.
No. The conversion runs entirely in your browser.
If the json to xml converter is not quite what you need, these other free tools solve closely related problems.
Turn an XML document into JSON, with attributes and text content preserved.
Pretty-print and validate JSON, with the exact line and column of any error.
Pretty-print XML with proper indentation, and catch malformed documents.
Convert an array of JSON objects into CSV, with nested fields flattened.
Translate between YAML and JSON, with clear errors on invalid indentation.