What the conversion preserves
Use YAML to JSON for a single YAML document or switch direction to turn JSON into YAML. Nested objects, lists and JSON-compatible values keep their structure and types.
For example, the YAML below produces an items array containing one object with name “tea” and quantity 2.
Enter items: on the first line, an indented - name: tea on the next, and a quantity: 2 property aligned with name. Both properties should appear in the JSON.
Strings, comments and references
Quote identifiers such as "00123" to preserve their text. YAML comments are omitted, while a hash inside a quoted string stays in the string.
The converter expands aliases in JSON and rejects circular references. JSON numbers use JavaScript numeric precision, so quote identifiers with very large digits.
Limits and errors
Use one YAML document per conversion. Input is limited to 100,000 UTF-16 code units, 50 levels of nesting, 50,000 expanded values and 1,000,000 UTF-16 code units of output.
A failed conversion clears the result. Review the converted file against the requirements of the application that will use it.