Private browser utility / Developer

JSON to XML Converter

Runs entirely in your browser - no upload, no sign-up.

Live workspaceLocal processing
XML options

Mapping: keys that start with @ become attributes, #text becomes element text, and array values repeat their parent tag.

JSON
XML
Paste JSON to convert it to XML.
Share this tool
json to xml / browser utility
01 / Overview

How do you convert JSON to XML?

Paste valid JSON and this JSON to XML converter maps objects to nested elements, arrays to repeated tags, and scalar values to text. You can set the root tag, choose the indentation, add a standard XML declaration, then copy or download the result. The conversion runs entirely in your browser.

02

How to use

  1. 01
    Paste JSON

    Paste or type a valid JSON value into the left editor, or load the example.

  2. 02
    Set the XML options

    Choose the format and, if needed, change the root tag, array item tag or XML declaration.

  3. 03
    Check the mapping

    Review the live XML output. Invalid JSON, tag names and unsupported mixed content are explained in the status bar.

  4. 04
    Copy or download

    Copy the finished XML to your clipboard or save the exact result as data.xml.

03

Who it's for

  • API developers adapting a JSON payload for a SOAP endpoint or another XML-only integration.
  • Data engineers preparing nested records for import into an XML-based workflow, feed or archive.
  • Testers and support teams turning sample API responses into readable XML fixtures without installing a converter.
  • Students comparing how objects, arrays, attributes and scalar values appear in the two formats.

JSON and XML organize data differently, so there is no single official one-to-one mapping. This converter uses predictable rules: object keys become element names, nested objects become nested elements, and array values repeat the element for their key. A top-level array uses the item tag from XML options.

For XML attributes, prefix a JSON key with @. For example, {"book":{"@id":"7","#text":"Dune"}} produces a book element with an id attribute and Dune as its text. Reserved XML characters are escaped, and keys that are not valid XML names are encoded into safe tag names. Everything runs locally with no upload or account.

FAQ

Is this JSON to XML converter free?

Yes. You can convert JSON to XML, copy the output and download the XML file without signing up or paying. There is no usage counter in the tool. Practical limits come from your browser's available memory and the cost of updating very large text live.

Is my JSON uploaded anywhere?

No. Parsing and XML generation happen locally in your browser. The JSON you paste is not sent to a conversion server, stored in an account or added to a queue, which makes the tool suitable for private API samples and configuration data.

How are JSON arrays converted to XML?

An array stored under an object key becomes repeated elements with that key. For example, a tags array produces one tags element per item. A top-level array is wrapped by the root tag and each value uses the configurable top-level array item tag.

How do I create XML attributes from JSON?

Start the JSON key with @. The input <code>{"book":{"@id":"7"}}</code> creates an id attribute on the book element. Attribute values must be strings, numbers, booleans or null. Use <code>#text</code> when the same element also needs text content.

What happens to spaces or invalid characters in JSON keys?

The converter encodes characters that cannot appear in an XML tag name. A space becomes a code-point marker such as <code>_x20_</code>, leading digits are encoded, and names beginning with the reserved letters xml receive a safe prefix. The output remains well-formed without dropping the field.

Does JSON to XML conversion preserve every data type?

No. XML element text does not inherently distinguish a JSON number, boolean, string or null. The visible values and hierarchy are retained, while null becomes an empty element. If the destination requires types, namespaces or a schema, validate and adapt the result to that contract.

Are special characters escaped in the XML output?

Yes. Ampersands and angle brackets in text are converted to XML entities, and quotes are also escaped inside attributes. Characters forbidden by XML 1.0, such as a null control character, produce a clear error instead of an invalid document.