XML, YAML & JSON Converter

Convert structured data while keeping values and XML attributes explicit.

Local processing · Up to 200,000 characters. Review the XML mapping below before using XML output in another system.

Understand the conversion

XML → JSON/YAML uses {"$xml":{"name":"root","attributes":{},"children":[]}}. Children retain element order and text; attributes stay strings.

JSON/YAML → XML uses a typed data document to preserve objects, arrays, numbers, strings, booleans, and null. A single $xml envelope instead restores the original XML tree.

Formatting and comments are lost. XML declarations, CDATA boundaries and processing instructions are omitted; XML whitespace normalization applies. YAML aliases, custom tags, non-string keys, and non-finite numbers are rejected. Numbers use JavaScript precision: quote precision-sensitive values as strings.

Found this useful? Share it

X LinkedIn Reddit WhatsApp

About XML, YAML & JSON Converter

Convert JSON-compatible YAML and JSON, or preserve an XML document as an ordered tree. Processing uses your browser’s XML parser and an established YAML parser, with no uploads. XML document types and entity declarations are rejected. Outputs are downloadable text files.

Frequently Asked Questions

Ordinary XML becomes an object with one reserved $xml key. Its element value has name, attributes, and children. Children keep text strings and nested elements in their original order. XML text and attributes stay strings. Converting this exact envelope back to XML restores the tree.

Ordinary values use a data root in the urn:utilzilla:json:1 namespace. Each value has a type: object, array, string, number, boolean, or null. Object entry elements carry a key attribute. This typed format round-trips values, including empty arrays and objects; it is not a schema for third-party APIs.

Formatting, YAML comments and anchors, XML comments and processing instructions, CDATA boundaries, declarations and entity spelling are not retained. XML attributes and text follow standard XML whitespace normalization. The $xml envelope is reserved. Only JSON-compatible YAML with string keys is accepted; aliases and custom tags are rejected. Numbers use JavaScript precision; quote precision-sensitive decimals and large integers as strings. Input is limited to 200,000 characters, 80 levels and 20,000 values.