Loading JSON workspace...

JSON to XML Converter

Build an XML document from JSON, or parse an XML document back into JSON. Text is escaped, each array item repeats its parent element name, and attributes come back as prefixed keys. Use the direction switch to go from XML to JSON without clearing the other pane.

How to use

  1. Paste JSON on the left for JSON to XML. For XML to JSON, switch direction and paste XML on the right.
  2. Convert. Several top-level fields are wrapped in a single root element so the document is well formed.
  3. Copy the result. An unclosed tag is reported with the line and column from the XML checker.

FAQ

Are angle brackets and ampersands escaped?
Yes. Characters that are not legal in element text are escaped, so the XML parser can read the document back.
How is an array written?
Each item repeats the parent element name. The name is not shortened by dropping the last character.
How do XML attributes become JSON?
Each attribute is a key next to the element text. The key uses an attribute prefix so it is distinct from child elements.
Can I convert XML to JSON on the same page?
Yes. Switch the direction to XML to JSON, edit the XML pane, and the left editor receives the parsed JSON.