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

XML to JSON

Parse and convert XML to JSON locally, with nested data and validation.

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

Map XML elements, attributes and text nodes to JSON, optionally parsing numbers and booleans.

Actions: Convert

Example

Enable value parsing: count and active become a number and boolean, while the @_id attribute remains the string "07".

Example action and settings

Action: Convert
Indent spaces: 2
Parse numbers and booleans: On

Input / action

<root id="07"><count>12</count><active>true</active></root>

Result / expected behavior

{
  "root": {
    "count": 12,
    "active": true,
    "@_id": "07"
  }
}

Available options: Indent spaces · Parse numbers and booleans

Scope and limitations

  • DTDs and custom entities are rejected; attributes use @_ keys and mixed text uses #text.
  • This object mapping does not guarantee preservation of mixed-content order or original XML formatting.

Common mistakes

  • Numeric parsing can lose leading zeros in identifiers; turn it off when exact strings are needed.

Related tools

JSON to XML JSON to YAML

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.