TL
Tool Lab
💰Donate
💰Donate

XML to JSON

Convert XML to JSON

XML Input
JSON Output

About This Tool

The XML to JSON Converter transforms XML documents into equivalent JSON: each XML element becomes a JSON key, child elements become nested objects, and repeated sibling elements with the same tag name are automatically grouped into a JSON array.

Text content is automatically inferred to numbers or booleans when appropriate ('30' becomes 30, 'true' becomes true). XML attributes are not included — only element content is converted. All processing runs locally in the browser.

How to Use

  1. Paste your XML into the XML Input area, or click Sample to load an example.
  2. Choose the JSON indent level (2 spaces, 4 spaces, or Minified).
  3. Click → JSON to convert.
  4. Click Copy to copy the JSON output to your clipboard.

Use Cases

Backend developers convert XML API responses to JSON for JavaScript frontends. Data engineers transform XML feeds to JSON for pipeline processing. Developers migrating from XML-based config files document their schema in JSON. Web developers convert RSS/Atom feeds to JSON for use in JavaScript applications.

FAQ

  • What happens to repeated elements with the same tag name?They are automatically grouped into a JSON array. For example, two <item> siblings become "item": ["value1", "value2"].
  • Are XML attributes converted?No. Only element text content and child elements are converted. XML attributes are ignored.
  • How are text values typed?Numbers and booleans are inferred automatically: '42' becomes 42, 'true' becomes true, 'false' becomes false. Everything else remains a string.