Toolbox / JSON to XML Runs in your browser中文
Converter

JSON to XML

Parse and convert JSON to XML locally, with nested data and validation. JSON5 is also supported.

Ctrl / ⌘ + Enter Run

Ready when you are

01

Add your contentPaste text or try a sample

02

Choose an actionClear options. Predictable results.

03

Take it with youCopy, download and carry on

Less switching. More focus.Functional build · Validation in progress

Using this tool

Build XML elements from object keys, using @_ attribute keys and #text for text content.

Actions: Convert

Example

root is the document element; @_id becomes an attribute and the empty string becomes a self-closing element.

Example action and settings

Action: Convert
Indent spaces: 2
Self-close empty elements: On

Input / action

{"root":{"@_id":"demo","name":"Ada","empty":""}}

Result / expected behavior

<root id="demo">
  <name>Ada</name>
  <empty/>
</root>

Available options: Indent spaces · Self-close empty elements

Scope and limitations

  • The input root must be an object; invalid XML element names are rejected and original JSON formatting is not preserved.

Common mistakes

  • Wrap data in one document element; an ordinary id key creates a child element, while @_id creates an attribute.

Related tools

XML to JSON

Privacy and browser support

Input is processed in this browser. Do not use real keys or active sensitive credentials as demonstration data. Device features require browser support and your permission.