JSON Beautifier
Format JSON with clean indentation and line breaks so it's easy to read.
Convert JSON data into clean, well-formed XML in one step. Choose the root element, how arrays are named and whether to include an XML declaration.
Paste or type to begin. Everything runs in your browser.
How it works
Paste JSON or load the sample. A single top-level key becomes the root element.
Arrays repeat their parent tag. Keys starting with @ become attributes and #text becomes text content.
Set a root or item name if you need one, then copy or download the XML.
About this tool
JSON is the default format for modern web APIs, but many systems still expect XML: SOAP services, RSS and Atom feeds, sitemaps, enterprise integrations, Android resources and legacy software. A JSON to XML converter translates the hierarchical structure of JSON into the tag-based structure of XML so the data can move between those systems.
This converter follows common conventions: arrays repeat their parent tag, keys that start with @ become attributes, a #text key becomes text content, and null becomes an empty element. Keys that aren't valid XML names are made safe automatically, and special characters are escaped.
Use @key for attributes and #text for element content.
Arrays repeat their parent element; top-level arrays use a configurable item name.
Element names are sanitised and &, <, > and quotes are escaped.
2 or 4 space indentation, or compact output, with an optional XML declaration.
FAQ
Each item becomes an element named after the array's key. For example, {"tag": ["a", "b"]} becomes <tag>a</tag><tag>b</tag>.
Prefix the key with @. For example, {"book": {"@id": "bk101", "title": "XML"}} becomes <book id="bk101"><title>XML</title></book>.
Characters that aren't allowed are replaced with underscores, and names that start with a number get an underscore prefix, so the output is always well-formed.
No. This tool runs entirely in your browser using JavaScript. Your files and text never leave your device, so it's safe for private or confidential work.
Missing something?
Instant.tools grows from real requests. Describe the task you're stuck on and we'll consider building it next.