Developer Tools
JSON / YAML / XML Converter
Convert between JSON, YAML and supported XML in your browser. Choose compact or indented output, swap formats and copy results. Review the XML mapping limits before use.
0 / 200,000 UTF-16 code units
XML conversion rules
• XML attributes become JSON/YAML keys prefixed with @, such as @id. In the reverse direction, attribute values must be strings, numbers or booleans.
• Text next to child elements is stored in #text. Repeated child elements with the same name become an array.
• XML text and attributes become strings. Original number and boolean types are not restored.
• Empty arrays, empty objects and null become empty elements. A one-item array cannot be distinguished from a single value. Nested arrays are rejected.
• One ordinary top-level key with a non-array value becomes the root element name. Array-valued keys, multiple keys and objects containing only @attributes or #text are wrapped in root. A root array uses root/item.
• Comments, formatting-only whitespace between child elements, mixed-content order and ordering across different child names are lost. Explicit whitespace from character references or CDATA and leading/trailing whitespace in leaf elements are preserved.
• DOCTYPE, ENTITY declarations, processing instructions, namespace prefixes (colons in names), invalid XML names and characters outside XML 1.0 are rejected. Reserved XML namespace URIs cannot be used as the default xmlns namespace.

