XML ↔ JSON
Convert or format XML. DOCTYPE and entities are rejected.
Added 2026-10-31
What it does
XML to JSON, JSON to XML, and XML formatting run in this tab. Attributes become keys that start with @. Text mixed with child elements becomes #text. A text-only element becomes a string, and an empty element becomes an empty string. Repeated sibling tags become an array. The other direction needs exactly one root name. DOCTYPE and ENTITY declarations are rejected, so an external entity is not fetched and is not expanded. Only the five predefined entities and numeric character references are decoded. A code point past Unicode, or a nested document deeper than 32 levels, stops. Surrounding whitespace inside an element is trimmed. The text is not uploaded.
How to use it
- Paste XML or JSON. The text stays in this tab.
- Choose convert to JSON, convert to XML, or format.
- Attributes use @. Repeated tags become an array. DOCTYPE stops the conversion.
Common mistakes
- DOCTYPE is rejected. DOCTYPE and ENTITY are not read. An external entity is not fetched.
- One root name. JSON to XML needs one root key. Two top-level keys are not one element.
Conversion stays in this tab. The text is not uploaded.
Related guides
- XML conversion does not expand entities
This XML converter rejects DOCTYPE and ENTITY. It does not fetch or expand an external entity.