Skip to content

JSON to XML

Turn JSON objects and arrays into well-formed XML.

How to convert JSON to XML

Three steps, all in your browser.

  1. 1

    Paste or open your data

    Drop a file or paste rows straight into the input box.

  2. 2

    Check the options

    Delimiter, header row, indentation: the output updates live.

  3. 3

    Download

    Save the converted file, or copy the output.

JSON to XML: what to know

JSON and XML both describe structured data, but older APIs, feeds and enterprise systems often still expect XML. This converter turns any JSON value into well-formed XML in your browser.

Everything is wrapped in a root element. Object keys become child elements, and values become their text. A top-level array becomes a series of item elements, while an array under a key repeats that key, so {"tag": ["a", "b"]} becomes <tag>a</tag><tag>b</tag>. Keys starting with @_ become attributes and a #text key becomes the element's text, which matches what the XML to JSON converter produces, so data can go back and forth. If your JSON is a single object that wraps everything, such as {"catalog": {...}}, its key is used as the root element unless you set one.

XML has stricter naming rules than JSON, so names are fixed where needed: spaces and symbols become underscores and a name that starts with a digit gets an underscore in front. Ampersands and angle brackets in text, and quotes in attributes, are escaped. The file starts with an XML declaration for UTF-8.

Popular uses

  • Sending data to SOAP services or older APIs that expect XML
  • Creating XML config or feed files from JSON
  • Moving data between web apps and enterprise systems

Tips for the best result

  • Rename the root and item elements to match the schema you're targeting.
  • Use @_ keys in your JSON for values that must be attributes.
  • Choose 0 indentation for a compact file, or 2 or 4 spaces to read it.
  • Validate the output against your schema if the receiving system is strict.

Read how JustYourConvert works and our privacy details. Keep your original files and check a converted file before you replace anything.

Frequently asked questions

A top-level array becomes a series of item elements inside the root element. An array under a key repeats that key as an element, so {"tag": ["a", "b"]} becomes <tag>a</tag><tag>b</tag>. You can rename the root and item elements.

It's fixed so the XML stays valid: spaces and symbols become underscores (first name becomes first_name), and a name that starts with a digit gets an underscore in front. Keys starting with @_ become attributes.

No. Every live tool on JustYourConvert opens and converts your files inside your browser, on your own device. Nothing is sent to our servers, and the result is saved straight from your browser.

Yes. Every tool is free, with no sign-up, no watermark and no daily limit. Clearly labeled ads keep it that way.

Only your device's memory. Because the work happens in your browser, very large files can be slow on phones and older computers. Each tool says its practical limit under the drop area.