YAML to JSON Converter - Convert YAML to JSON Online
Convert YAML to JSON
Paste YAML on the left and formatted JSON appears on the right. Use it to feed a config file to an API or script that only takes JSON, or to see exactly how a parser reads your YAML. Indentation mistakes and surprising types are much easier to spot in JSON, where every string has quotes and every nesting level has braces. Parsing happens in your browser.
Example
version: 1.10
zip: 012
country: NO
release: 2024-01-05
base: &base
image: node
web:
<<: *base
port: 80 converts to:
{
"version": 1.1,
"zip": 12,
"country": "NO",
"release": "2024-01-05",
"base": { "image": "node" },
"web": { "image": "node", "port": 80 }
}
The version and ZIP code lost their formatting because unquoted they
are numbers. NO and the date stayed strings under YAML 1.2
rules, and the merge key copied image into
web. (The real output puts each key on its own line.)
Parsing Details
- Block and flow styles, quoted and block scalars (
|,>) and multi-line strings are all supported. - Integers larger than 253 are kept exact rather than rounded.
- Syntax errors, such as a tab used for indentation, are reported with the line and column instead of producing partial output.
- A missing space after a colon is not an error:
key:valueis read as the single string"key:value". If a key disappears from the output, look for this. - Custom tags such as
!Refin CloudFormation templates are dropped and only the value is kept, so!Ref MyBucketbecomes"MyBucket".
To go the other way, use the JSON to YAML converter. To explore a large result, paste it into the JSON tree viewer.
Related Tools
JSON to YAML Converter
Convert JSON data to clean, readable YAML format instantly.
JSON to XML Converter
Transform JSON objects and arrays into well-formed XML documents.
JSON to CSV Converter
Flatten JSON arrays into downloadable CSV spreadsheets in one click.
XML to JSON Converter
Parse XML documents and convert them to JSON objects.