Structured Data

XML to JSON Converter

Paste XML and get clean, predictable JSON — attributes, repeated elements, and numbers are handled for you. Copy or download the result. Everything runs in your browser, so your data never leaves the page.

Runs in your browser v1.0.0

Conversion options

updates live
Attributes
Text values

Sibling elements with the same tag always become one array; with the default, a single child stays an object so simple records read naturally.

Advanced options
Root element

XML input

never uploaded

Parsed in this page. Malformed XML is reported with a line and column instead of a broken state.

JSON output

ready


                

How the conversion works

Each element becomes an object. Attributes are added as @name fields, child elements become keys, and repeated sibling tags become arrays. An element with only text becomes that text value; an element that also has attributes or children keeps its text under #text. Attribute values stay strings so identifiers like id="007" are not mangled, while text values can be converted to numbers and booleans. Comments and processing instructions are ignored, and CDATA is treated as text. The optional share link keeps your XML and options in the URL fragment, which never leaves your browser.