What the conversion preserves
JSON does not retain YAML comments, anchors or formatting. Duplicate keys and excessive aliases are rejected. Review the result before using it in an API.
API configuration
Use a single YAML document when preparing an API request. YAML comments and anchor names are not part of the resulting JSON.
Check the converted file
Check that true, false and null have the intended types. A duplicate mapping key should produce an error rather than silently overwrite a value.
Convert YAML to JSON online
A YAML mapping with nested lists. Compare parsed values, not whitespace or comments.
JSON cannot retain YAML comments or every YAML-specific feature.
Convert one YAML document
Choose a YAML file up to 10 MiB or paste source text. The browser uses the yaml library with the core schema, unique mapping keys and an alias expansion limit of 50, then formats the result with two-space JSON indentation. The tool is intended for a single document rather than a multi-document YAML stream.
Check the meaning of scalar values
For example, a mapping containing code: "001", enabled: true and quantity: 4 should produce a string, boolean and number respectively. Review the output types rather than comparing only visual formatting. YAML parser versions and schemas can interpret some unquoted values differently, so verify the destination's expectations.
Understand what JSON cannot retain
Comments, anchor names and YAML formatting do not survive JSON serialization. Supported aliases may become repeated data. Duplicate mapping keys and excessive alias expansion can cause errors. Advanced tags and non-string mapping keys may not have faithful JSON equivalents. JavaScript numeric precision can also affect very large integers.
Troubleshoot and validate
Check indentation, duplicate keys and document separators if conversion fails. Use spaces rather than tabs for indentation. Download the result and parse it using the receiving application, then validate required fields and types. Keep the original YAML, especially when it contains comments explaining important settings. Avoid sharing configuration secrets in support requests.
Questions before you convert
Are duplicate keys accepted?
The converter rejects duplicate mapping keys.
Does YAML to JSON preserve comments?
No. JSON has no comment syntax; compare parsed values instead.