XML <-> JSON

Convert XML and JSON with predictable attribute and text mappings.

Input

Output

About

Convert XML nodes into JSON using @attributes, #text, and arrays for repeated elements, then convert that mapping back to XML.

Key Features

  • Attributes, text, CDATA, and repeated elements
  • Deterministic round-trip mapping

How to use

  1. 1Select XML to JSON or JSON to XML.
  2. 2Paste data and convert it.

Example

Input

<user id="007"><name>Ada</name><tag>a</tag><tag>b</tag></user>

Output

{"user":{"@attributes":{"id":"007"},"name":{"#text":"Ada"},"tag":[{"#text":"a"},{"#text":"b"}]}}

Limitations

  • Input is limited to 2,000,000 characters to keep the browser responsive.
  • Mixed-content XML preserves content but cannot always reproduce the original whitespace or node ordering.
  • All input is processed locally in your browser and is never uploaded to ToolHub.

Last reviewed:

Related Tools