YAML to JSON Converter
Paste YAML to get JSON — or switch direction to turn JSON into clean YAML. Errors are shown with line numbers.
Text Tools
Paste YAML to get JSON — or switch direction to turn JSON into clean YAML. Errors are shown with line numbers.
YAML and JSON describe the same kinds of data — objects (maps), arrays (lists), strings, numbers, booleans and null. JSON uses braces, brackets and quotes and is the language of APIs. YAML uses indentation and is popular for configuration: Kubernetes manifests, Docker Compose, GitHub Actions, Ansible playbooks and OpenAPI specs. In fact, every JSON document is also valid YAML 1.2.
| YAML | JSON |
|---|---|
name: Ana | {"name": "Ana"} |
tags: | {"tags": ["admin", "beta"]} |
enabled: true | {"enabled": true} |
port: "8080" | {"port": "8080"} (string, because it is quoted) |
&defaults / *defaults) and merge keys (<<: *defaults) are expanded, since JSON has no references.| (keep line breaks) or > (fold into one line) become normal JSON strings with \n where appropriate.# …) are dropped, because JSON does not support them.--- become a JSON array, one element per document.key:value is a single string; write key: value.@, `, * or containing : need quotes.When parsing fails, the converter shows the reason with the line and column, so you can jump straight to the problem. The YAML parser follows the YAML 1.2 core schema, so yes, no, on and off stay strings rather than turning into booleans as they did in YAML 1.1.
Conversion runs in your browser — configuration files with internal hostnames or keys are not uploaded. To check or prettify JSON, use the JSON Formatter.
JSON Formatter, JSON to CSV, Markdown to HTML Converter, Base64 Encode/Decode.