JSON ↔ YAML Converter
Convert JSON to YAML and YAML to JSON.
Input
Output
What is JSON ↔ YAML Converter?
Convert JSON-compatible data between JSON and YAML in your browser. Nested objects, lists, empty containers, booleans, null and Unicode text are handled by a YAML parser rather than a line-by-line approximation. This is a data conversion, not a byte-for-byte rewrite or a validator for Kubernetes, Compose or other application schemas.
How to use JSON ↔ YAML Converter
Paste {"user":{"name":"Mira 🥷","roles":["reader","editor"]},"active":true,"note":null,"empty":{}} into Input and choose JSON → YAML. Expect a user mapping with the original name, a two-item roles list, active as true, note as null and an empty mapping for empty. To check the reverse direction, copy the YAML output into Input and choose YAML → JSON. The same JSON data should return; indentation and quoting can change.
When is JSON ↔ YAML Converter useful?
Use the converter to move a configuration value or test fixture between systems that expect different formats. Paste {user: {name: "Mira 🥷", roles: [reader, editor]}, active: true, note: null, empty: {}} and choose YAML → JSON to try compact YAML syntax directly. Quotes around text such as "00123" preserve it as a string; an unquoted number is interpreted as a numeric value.
Example
Try user: [reader with YAML → JSON: the unclosed list must produce an error instead of a partial object. {name: Mira, name: Zero} also produces a duplicate-key error. When conversion fails, the output is replaced by the error and the original input remains available for editing.
Practical notes
YAML uses a JSON-oriented schema here: untagged dates stay strings, and YAML-specific tags such as !!timestamp are not accepted. Use string mapping keys; YAML keys with other types can be normalized to JavaScript strings. Duplicate YAML keys, multiple documents, circular aliases, non-finite numbers and integers outside JavaScript’s safe range produce errors. Quote large identifiers as strings. Comments, anchors, formatting, duplicate JSON keys and original number notation are not preserved. Ordinary numbers use JavaScript precision. Conversion does not execute the input or send it to an API. The YAML library is loaded from the same CDN used by the YAML tools; if that request is blocked, the page reports an unavailable parser. See the parser documentation for supported YAML syntax.