Hire me

JSON to XML Converter

Turn JSON objects and arrays into well-formed, indented XML.

  • Free, no sign-up
  • Code stays in your browser
  • Works on phone and desktop

Objects become nested elements, arrays become repeated elements with the parent key’s name, keys starting with @ become attributes and #text becomes element text. Invalid XML names are made safe automatically.

How to convert JSON to XML

  1. Paste JSON or open a .json file.
  2. Set the root element name and indentation.
  3. Press Convert to XML, then copy or download.

Element names

XML names cannot start with a digit or contain spaces, so keys like 2024 sales become _2024_sales. Special characters in values are escaped (&, <, >).

Frequently asked questions

Does it add an XML declaration?

Yes, an <?xml version="1.0" encoding="UTF-8"?> declaration is added at the top.

Updated October 2026 · Built and tested by Sharjeel Tahir · How our tools are tested