Offline engine (processed locally)JSON v1.0.0 Spec

XML to JSON

v1.0.0

Transform XML documents into JSON with a single click. Our converter handles attributes, nested elements, and arrays intelligently, producing clean JSON perfect for APIs, web services, or data interchange. Free, secure, and works entirely in your browser—no XML file touches a server.

—ms
XMLInput (XML)
lines: 5chars: 88Size: 88 BUTF-8
JSONOutput (JSON)
Converted output will appear here
lines: 0chars: 0Size: 0 BUTF-8
Size change: -100.00%TOML compliant: v1.0.0

Tool guide

Nested elements

XML parent-child structure is mapped to JSON objects.

XML attributes

Attributes are converted alongside element content.

Local processing

XML content is processed on your device.

Read the result in your project

import { xml2js } from "xml-js";\nimport { readFile } from "node:fs/promises";\n\nconst xml = await readFile("document.xml", "utf8");\nconst result = xml2js(xml, { compact: true });\nconsole.log(JSON.stringify(result, null, 2));