YAML to JSON
Paste YAML and get JSON, using the js-yaml parser in this tab. Multiple documents can be collected into a JSON array. This is YAML 1.1 as implemented by js-yaml, not a full YAML 1.2 library.
YAML
Limits
- The input is limited to 2 MB of UTF-8 text (8 MB if you load a file). Larger files can run out of memory in a phone browser tab.
- YAML 1.1 (js-yaml default schema), not a complete YAML 1.2 implementation.
- Custom tags, explicit type tags beyond the default schema, and some merge-key cases are not supported.
- JSON cannot represent repeated anchors as shared references; js-yaml is used with noRefs when going the other way.
- Duplicate keys: later keys overwrite earlier ones, as in typical JS objects.
JSON
How to use YAML to JSON
- Paste YAMLType, paste or load a .yaml / .yml file.
- Choose optionsSet JSON indent, and turn on “all documents” if the file uses --- separators.
- Copy or downloadCopy the JSON or download a .json file.
js-yaml and YAML versions
Conversion is done by js-yaml 4 (MIT) with its default schema. That schema follows YAML 1.1 in several details: values such as on/off, yes/no and some sexagesimal numbers may become booleans or integers, and some YAML 1.2-only constructs are not accepted.
Custom tags, merge keys in every edge case, and circular anchors that cannot be expressed in JSON will fail or drop information. Binary tags are not written as bytes in the JSON; they become strings or are rejected. Very large files may run out of memory.
Frequently asked questions
Is my text or file uploaded?
No. Everything runs in your browser tab with JavaScript. Nothing you type, paste or drop is sent to a server, logged or stored by ALink Tools.
Why did “on” become true?
YAML 1.1 treats on, off, yes and no as booleans. Quote the value if you want a string: "on".
Can I convert several documents at once?
Yes. Turn on “Convert all documents” and a --- separated stream becomes a JSON array.
Is the YAML sent to a server?
No. js-yaml runs in this tab.
Related tools
All toolsJSON to YAML
Convert JSON to YAML 1.1 in your browser with js-yaml.
JSON Formatter & Validator
Format, minify, sort keys, and catch syntax errors cleanly.
JSON to CSV
Turn a JSON array of objects into a CSV table, with optional flattening of nested keys.
XML Formatter
Pretty-print or minify XML in your browser, without sending it to a server.