YAML to JSON Converter
Paste YAML made of nested maps, lists, strings, numbers, booleans and null and get pretty JSON. Anchors, block scalars and flow collections are rejected with a clear message.
Paste YAML made of nested maps, lists, strings, numbers, booleans and null and get pretty JSON. Anchors, block scalars and flow collections are rejected with a clear message.
YAML is a human-friendly format used for configuration files. JSON is what most APIs and programs expect. This tool converts a simple, commonly used part of YAML into JSON.
It is a deliberately small parser. It handles nested maps by indentation, lists with dashes, comments, quoted and plain strings, numbers, booleans, null, and empty [] and {}. Anything outside that is rejected with a message rather than converted wrongly.
name: App
ports:
- 80
{"name": "App", "ports": [80]}
Maps by indentation with spaces, lists with "- ", comments with #, single and double quoted strings, numbers, true and false, null or ~, and empty [] and {}.
Anchors and aliases (& and *), tags (!), block scalars (| and >), flow collections with content such as [1, 2] or {a: 1}, multi-line plain strings and multiple documents separated by ---. The tool reports an error for each.
No. Only true and false are booleans, as in YAML 1.2. Yes, no, on and off stay as strings.
YAML does not allow tabs for indentation. Replace them with spaces.
No. For complex files, use a complete parser in your own project. This tool is for quick conversions of simple files.
No. It is parsed in your browser.
Plain integers and decimals become JSON numbers, and 0x and 0o values are converted to decimal. A number with a leading zero, such as 007 or a zip code, stays a string so its digits are not lost.