JSON to XML & XML to JSON Converter

Convert JSON to XML and XML to JSON with attribute support, custom root element and attribute prefix. Validates XML and keeps numbers and booleans typed.

Runs 100% in your browser. Nothing you paste is uploaded.

JSON

XML

About the JSON ↔ XML

Bridge REST and SOAP worlds. JSON keys starting with the attribute prefix (default @) become XML attributes and #text becomes element text; arrays become repeated elements. In the other direction, attributes are kept with the same prefix and numeric/boolean values are typed.

Features

  • Attributes via configurable prefix
  • Custom root element
  • Arrays → repeated elements
  • XML validation with line numbers
  • Typed numbers and booleans
  • Optional XML declaration

How to use it

  1. Pick the direction.
  2. Adjust root name and attribute prefix if needed.
  3. Paste the data and copy the result.

Frequently asked questions

Why is a single item not an array in JSON?

XML has no array concept — a single <item> becomes an object, two or more become an array. Handle both shapes in code, or post-process with a schema.

Esc