FreeConvert1PDF, document and archive tools
Tool index A–Z

JSON to XML

Many government portals, payroll bureaus and ERP imports accept XML only, while modern tools hand you JSON. This page bridges the two: it writes a UTF-8 XML document from your JSON, with element names cleaned up so the file is accepted by strict parsers.

Choose files
or drop them here
JSON · JSONL · NDJSON · folders work too
Processed on your device: your files are never uploaded.No sign-upNo watermarkNo daily limitNo queue

How to convert JSON to XML

  1. Pick the JSON or JSON Lines file.
  2. Type the root element name the receiving system expects, if the JSON does not already have one top-level key.
  3. 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.