How to convert JSON to XML
- Pick the JSON or JSON Lines file.
- Type the root element name the receiving system expects, if the JSON does not already have one top-level key.
- Convert and download the XML.
Structure of the XML
Each JSON key turns into an element of the same name, and its value becomes the element text. A list repeats the element once per entry: "employee": [ … ] gives one <employee> block per person. A list at the very top is placed inside the root element, each entry named item unless you choose another name under More settings.
When the whole JSON is one object with a single key, for instance {"payroll": { … }}, that key becomes the root element automatically.
Attributes from @ keys
To write an attribute, start the key with @. {"amount": {"@currency": "EUR", "#text": "120.00"}} becomes <amount currency="EUR">120.00</amount>, a pattern found in invoices and bank files. The XML to JSON page produces exactly this shape, so you can convert, edit and convert back.
Empty values and null produce self-closing elements like <middleName/>, and numbers are copied with their original digits in current browsers.
Cleaning names and text
Keys with spaces or symbols are not allowed as XML names, so "Cost centre" becomes <Cost_centre> and a key that starts with a digit gets a leading underscore. Ampersands and angle brackets in values are escaped.
Invisible control characters, which sometimes slip in from database exports and make strict XML parsers refuse a file, are removed during the conversion.
Questions
Does the output follow a portal's XSD?
Only if the JSON already uses the right names and nesting. There is no schema mapping step.
Is there an XML declaration?
Yes, the file begins with <?xml version="1.0" encoding="UTF-8"?>.
Can I convert several JSON files at once?
Yes. Each file becomes its own XML document, and Download all collects them in a single ZIP.