JSON to XML

Converts JSON to XML: fields with "@" become attributes, arrays become repeated tags, and field order is preserved.

Paste JSON or open a file. Fields starting with "@" become attributes, the "#text" field becomes the element's text, and an array becomes repeated tags. Field order is preserved, and long numbers are not rounded.

A tag name in XML starts with a letter or an underscore and contains no spaces. The field "2024" becomes the tag "_2024", and "key with space" becomes "key_with_space". The list of fixed names appears under the result.

An XML document has a single root. If the top level of your JSON holds several fields or an array, everything is wrapped in a "root" tag. A note under the result tells you when this happened.

The less-than, greater-than, and ampersand characters are written as entities, and in an attribute value quotes and line breaks get escaped too. Without this, no parser could open the finished file.

Rate this tool

Help us get better

Other tools