All tools

XML ↔ JSON Converter

Convert XML to JSON and back.

DOMParser is not defined

XML attributes become keys prefixed with @. Repeated child tags become arrays. Single text-only nodes collapse to a string. JSON to XML expects exactly one root key.

About

XML attributes become @-prefixed keys. Repeated child elements become arrays. Single text-only elements collapse to strings. JSON to XML expects a single root key.

How to use

  1. Pick the direction.
  2. Paste your input.
  3. Copy the output.

FAQ

Why are attributes prefixed with @?+

It's the convention from BadgerFish and most XML to JSON specs. Keeps attributes distinguishable from child elements when both could share a name.