XML to JSON
Convert XML into an ordered JSON element tree that retains attributes and mixed text content.
Loading tool…
How to use XML to JSON
Inspect XML as explicit JSON nodes instead of guessing how repeated elements should map to properties. Each element records its name, namespace, attributes, and ordered text or element content.
- Paste a well-formed XML document without a DTD.
- Select Run tool to build an ordered element-and-text JSON tree.
- Review the result, then copy it or download the generated file.
Good to know
- Up to 100,000 characters, 10,000 nodes, and 40 nesting levels. DOCTYPE and entity declarations are rejected.
- Comments, processing instructions, declaration details, and the distinction between CDATA and ordinary text are not preserved. This is not a vendor-specific XML mapping.
Common questions
How are repeated elements handled?
They remain separate nodes in the ordered content array, so repetition and mixed content are not collapsed.
Keep going with related tools
All data →JSON to XML
Convert JSON into escaped, typed XML while preserving arbitrary object keys and array ordering.
DeveloperXML Formatter
Validate and indent XML locally, preserving mixed text content and rejecting entity declarations.
DeveloperJSON Viewer
Inspect a JSON document as a safe path, type, and value tree without executing its contents.
FilesGPX Track Inspector
Inspect bounded GPX1.1 track,route and waypoint coordinates or export a segment-preserving GeoJSON copy.
TextXLIFF Segment Inspector
Inventory source/target segments from a bounded XLIFF1.2 or2.0 XML profile without translating content.
FilesOPML2 Outline Workbench
Inspect an OPML2 outline file or generate a safe outline document from a declared JSON tree.