Convert · Runs in your browser

JSON to XML Converter

Convert JSON into well-formed XML. Keys become elements, arrays become repeated elements, and @-prefixed keys become attributes.

JSON
Drop a file to load it
XML
Waiting for input

How to use it

  1. Paste JSON into the left editor, or upload a .json file.
  2. Set the root element name and indentation.
  3. Copy the XML or download it as an .xml file.

Attributes & text

Keys starting with @ become attributes, and a #text key sets the element’s text: {"price": {"@currency": "EUR", "#text": 9.5}} → <price currency="EUR">9.5</price>.

Arrays

An array under a key becomes one element per item with that key as the tag name. Arrays nested directly in arrays use <item>.

Element names

Characters that aren’t allowed in XML names are replaced with “_”, and names that start with a digit get a leading “_”.