IT Market
Tools/Code/Documents/JSON to XML Converter Online — Download
JSON → XML

Конвертируйте JSON в XML формат

Tool guide

JSON to XML Converter Online — Download

XML still runs the places where an integration was wired up years ago: catalogue feeds, price lists for marketplaces, SOAP endpoints and legacy importers that accept nothing else. This converter builds a tag tree out of JSON — keys turn into element names, nested objects into child nodes, arrays into repeated tags. Next to Copy XML there is a Download XML button: the file is assembled and saved locally, with nothing sent onward. See also: turn the XML back into JSON, pretty print the resulting XML, get the same object as YAML for a config file.

How to use it

  1. Paste your data into the JSON Input box; either an object or an array at the top level will do.
  2. Press Convert and the tag tree appears in the XML Output box, indented by nesting level.
  3. Look over the tag names: characters XML does not allow become underscores, and a name starting with a digit gets one in front. Every such rename is listed in the status line.
  4. Press Copy XML when you want to paste the result into an editor, a request body or a ticket.
  5. Press Download XML to save a file you can hand to an importer or upload in a marketplace dashboard.

FAQ

Why does the XML I got fail validation?

The page repairs tag names itself: a character XML rejects becomes an underscore, a key starting with a digit gets one in front, and every rename is named in the status line. Keys like 2024 or order date therefore produce a valid document — with changed names, so check them against the receiving schema. If a validator still complains, the cause is usually the schema itself: a required element order, a namespace, or a value type.

Can some fields become tag attributes?

Yes. Put them under the @attributes key and its contents become attributes rather than child elements: {"offer":{"@attributes":{"id":"A-1"},"#text":"Laptop"}} yields Laptop. The #text key sets the element's own text. Every other field still becomes a child tag, and quotes and apostrophes inside attribute values are escaped.

How is an array of objects represented?

Each element is emitted as its own tag carrying the array's key as the name, giving you a run of identically named sibling nodes. That is the standard XML way to hold a list. Note that a one-element list stops looking like a list on the way back: XML cannot distinguish a single-item collection from a plain field.

Does the file include a declaration and a single root?

Check the first line of the output. If there is no declaration and your importer insists on one, add that line before uploading. Strict parsers also demand exactly one root element, and a top-level array yields several sibling nodes, so wrap them in a container tag yourself.

What happens to < > and & inside my values?

Those characters are markup in XML, so correct output replaces them with the &lt;, &gt; and &amp; entities. Inspect product descriptions and any field holding HTML fragments: if the raw characters survived, the document breaks the moment it is parsed. Where you are unsure, wrap the value in a CDATA section by hand.

Where does the data I paste actually go?

Nowhere. Building the tree and preparing the file behind the Download XML button are both done by a script inside the page. The file is assembled in browser memory and saved through the normal download dialog, bypassing any server. A price list with buying prices can be converted here without clearing an external data transfer.

Examples

Product entry for a price feed
Before: {"offer": {"id": "A-1", "name": "Desk chair", "price": 8900}}
After: A-1 Desk chair 8900
An array becomes repeated tags
Before: {"tags": ["sale", "new"]}
After: sale new