Converters

JSON to XML Converter

Convert JSON to clean, indented XML — or parse XML back into JSON — with sensible handling of attributes, arrays and text.

Loading JSON to XML…

How it works

How to use the JSON to XML

  1. Paste JSON

    Or switch to XML → JSON and paste XML instead.

  2. Set the root element

    Choose the root tag name and indentation, and whether to include an XML declaration.

  3. Copy or download

    The output updates instantly; download it as a .xml or .json file.

Mapping rules

  • Object keys become elements; invalid XML names are sanitized (e.g. first name → first_name).
  • Arrays become repeated elements with the same tag name.
  • Keys starting with @ become attributes, and #text becomes element text.
  • Special characters are escaped (&, <, ").
  • XML → JSON groups repeated child elements into arrays and can convert numeric and boolean text into JSON types.

Built for developers

Why developers use it

  • Private by design

    Runs 100% in your browser. Nothing you paste is uploaded, logged or stored on a server.

  • Instant results

    Output updates as you type, with precise error locations when something is wrong.

  • Works offline

    Once loaded, the tool keeps working without a connection. Install it as an app if you like.

  • Free, no sign-up

    No accounts, no limits, no watermarks.

FAQ

Frequently asked questions

How are XML attributes represented in JSON?

As keys prefixed with "@", for example <book id="7"> becomes {"book": {"@id": 7}}. The same convention works in reverse.

Why did an element turn into an array?

When a tag repeats inside the same parent, its values are collected into an array, because JSON objects cannot contain duplicate keys.

Is my data uploaded anywhere?

No. This tool runs entirely in your browser. Your input never leaves your device, is not logged, and works offline once the page has loaded.

Keep going

Related tools

Private by design

Your data never leaves your browser.

498 free tools that run locally — no uploads, no sign-up, no tracking of what you paste. They even work offline.

  • 498free tools
  • 0bytes uploaded
  • 23categories