Skip to content
Input
XML
Limit
1 MiB
Runtime
Browser

Convert XML into a lossless JSON tree

Project XML into the lossless-xml-ast-v1 envelope so ordered children, qualified names, attributes, text, comments, CDATA, and processing instructions remain explicit.

Local processingNo sign-upNo network access

Convert XML to JSON

Inputs are limited to 1 MiB and stay in this browser tab.

Paste or edit the source. Tool Swim does not upload or save it.

lossless-xml-ast-v1 JSON

Nothing is placed in a URL, account, or remote log.

What this tool does

XML 1.0, bounded, and local

XML is an ordered tree, while ordinary JSON object mappings cannot represent repeated sibling names or mixed content reliably. A typed AST avoids silently collapsing those distinctions.

Identity is structural, not byte-for-byte

The envelope preserves ordered nodes and namespace identity. Source quote choice, line endings, entity spelling, and other lexical presentation may normalize when JSON is converted back to XML.

The representation marker prevents guessing

Every result declares representation: lossless-xml-ast-v1. JSON-to-XML accepts that documented envelope instead of interpreting arbitrary objects as elements.

Primary references

Questions and answers

Related XML tools