100% Client-Side • Free • Zero Server Transfer

JSON to XML & XML to JSON Converter

Free online JSON to XML and XML to JSON converter. Custom root tag, indented well-formed output and repeated array siblings for SOAP, RSS and legacy APIs.

JSON Input
XML Output
In short

JSON to XML conversion maps each object key to an element tag, primitive values to tag text, and repeated array items to sibling elements under one root node. Paste JSON on the left, set the root tag name, and the right pane returns indented, well-formed XML.

Converting JSON to XML wraps each object key in an element tag, writes primitive values as tag text, and repeats a tag for each array element, all beneath a single configurable root. JSON2X converts in both directions in the browser. It exists mostly to bridge modern JSON clients to SOAP endpoints, RSS feeds, and enterprise systems that still speak XML.

Why is a root element required?

Because the two data models differ. A JSON document may be an array, a string, or a number at the top level; a well-formed XML document must have exactly one root element containing everything else. So [1,2,3] cannot be expressed as XML without inventing a wrapper — hence the configurable root name. The same asymmetry means XML → JSON conversion normally discards that wrapper, which is why round trips need the root name supplied again.

How are arrays represented?

As repeated sibling elements. {"item":[1,2]} becomes <item>1</item><item>2</item>, because XML has no bracket syntax for sequences. That representation is idiomatic but ambiguous in reverse: a single <item> element is indistinguishable from a one-element array, so XML → JSON conversion cannot know whether to emit a value or an array of one. If a downstream consumer requires an array, normalise it explicitly after conversion.

What about attributes and types?

JSON has no concept of an attribute, so keys map to child elements by default; attribute mapping is available for keys you nominate. Types are the other loss: XML text content is untyped, so the number 42, the boolean true, and the strings "42" and "true" all serialise identically. Converting back therefore relies on inference. Where types must survive, pair the XML with an XSD, or keep JSON as the canonical format and treat XML as a transport skin.

How to use the JSON to XML

Takes under a minute. Nothing is uploaded — every step runs in this browser tab.

  1. Paste JSON

    Put your document into the left-hand input pane, or switch the toggle to XML → JSON to convert the other way.

  2. Set the root element

    XML requires exactly one root element while JSON does not, so choose a wrapper name such as root, data, or response.

  3. Read the XML

    The right-hand pane shows indented, well-formed XML with reserved characters escaped as entities.

  4. Copy into your request

    Copy the document into a SOAP body, a feed template, or a legacy integration payload.

When to use it

  • Calling a SOAP or legacy enterprise endpoint from a service that works in JSON
  • Generating an RSS or sitemap fragment from JSON data
  • Producing XML for a banking, healthcare, or government interchange format
  • Converting an XML API response into JSON your frontend can use directly
  • Inspecting an XML configuration file as JSON because the nesting is easier to read

Step-by-step guides for this tool

Task-specific walkthroughs covering the most common ways this tool gets used.

Searches this page answers

  • json to xml online free
  • free json to xml converter
  • xml to json converter online
  • convert xml to json online
  • free xml to json converter
  • convert json to xml with root tag
  • json to soap xml
  • json to xml formatter
  • json xml converter no upload

Frequently Asked Questions

How does JSON to XML mapping work?

Object keys become XML tags, primitives become tag contents, and array items repeat matching enclosing element tags under a configurable root node.

Can I customize the XML root tag name?

Yes. Specify custom root element tags such as <root>, <data>, or <response> in the toolbar.

How do I convert XML to JSON?

Switch the direction selector to XML → JSON and paste your XML. Element names become object keys, text content is coerced to a number or boolean where it looks like one, and repeated sibling elements collapse into a JSON array.

Are XML attributes preserved in the JSON output?

No. Both directions work on elements and text only, so attributes on incoming XML are dropped and JSON keys always become child elements rather than attributes. For attribute-heavy documents, treat the output as a starting point.

Is this JSON to XML converter free, and is my payload uploaded?

It is free with no signup, and nothing is uploaded. Conversion runs in your browser, so SOAP envelopes and internal API payloads never leave your machine.

Related Developer Tools

Last reviewed by the JSON2X Engineering Team.