Does XML to JSON preserve CDATA, comments, and mixed-text order?
Answer for this converter: No. In five live tests, ParseBloom omitted CDATA content and comments. It combined ordinary text around a child element into one _text value, so the child's original position could not be reconstructed. Keep the XML source when those details matter.
One diagram: what survives this mapping
The browser's XML parser distinguishes node types. ParseBloom's current mapper reads ordinary text nodes and child elements, but does not add CDATA or comment nodes to its JSON object. This is an observed limit to check before using the output in a migration.
Five copyable tests and observed outputs
Each synthetic XML sample was typed into the public converter and converted on 27 October 2026. JSON is compacted here; the tool displays indented output.
<r><![CDATA[A < B]]></r>{"r":""}The CDATA characters do not appear. A successful parse does not prove that all text survived.
<r>left<![CDATA[right]]></r>{"r":"left"}Ordinary text survives; the CDATA segment does not. This isolates which node type was dropped.
<r>alpha<!-- note -->beta</r>{"r":"alphabeta"}The comment is omitted, and the ordinary text nodes join. The result cannot show that a comment separated them.
<p>before<b>bold</b>after</p>
<p>beforeafter<b>bold</b></p>{"p":{"_text":"beforeafter","b":"bold"}}The child moves relative to the final text, yet both inputs map to the same object. JSON alone cannot tell which order was used.
Two inputs collapse to one result
The matching outputs are an information-loss test, not a guess about how the original XML was laid out.
A decision check before you use the JSON
If the next system needs only ordinary element text and child values, the output may be enough. If it must reproduce documentation, HTML-like prose, XML comments, or CDATA payloads, retain and process the XML source with a mapping that explicitly records those node types and their sequence.
Test an actual document containing the features you depend on. Compare its XML source against JSON field by field. The two distinct mixed-content inputs above are a quick check: identical output proves a reverse conversion cannot recover their differing order from this JSON shape.
A different library may keep CDATA as text or represent comments with explicit keys. Check that library's mapping and run the same fixtures; do not transfer this result by assumption.
Watch the five-test walkthrough
If the player does not load, watch the video on YouTube.
Questions behind these tests
Can I reconstruct where a child appeared among text segments?
Not from this converter's JSON. The two tested <p> inputs produce the same object despite different child positions. A public developer question about reconstructing node order shows why the distinction matters.
Does CDATA become ordinary text?
Not in the current ParseBloom mapping: the CDATA-only test produced an empty string. Other tools can make a different choice; a public CDATA conversion question shows the result depends on the mapper. Preserve XML if you cannot afford to lose the content.
Also see the attribute and leading-zero guide and the single-versus-array guide.