YAML to JSON Converter

Paste YAML to get JSON — or switch direction to turn JSON into clean YAML. Errors are shown with line numbers.

Input
Output
Ready

YAML and JSON: same data, different syntax

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.

YAMLJSON
name: Ana{"name": "Ana"}
tags:
  - admin
  - beta
{"tags": ["admin", "beta"]}
enabled: true{"enabled": true}
port: "8080"{"port": "8080"} (string, because it is quoted)

YAML features that are converted for you

Common YAML errors

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.

Frequently asked questions

Is JSON valid YAML?
Yes. YAML 1.2 is a superset of JSON, so any valid JSON document can be read by a YAML 1.2 parser.
Why are my YAML comments missing in the JSON?
JSON has no comment syntax, so comments cannot be carried over. They are dropped during conversion.
Does it convert Kubernetes or Docker Compose files?
Yes. Any standard YAML works, including files with several documents separated by ---, which become a JSON array.
Why is "yes" not converted to true?
The converter follows YAML 1.2, where only true and false are booleans. Words like yes, no, on and off remain strings.

Related tools

JSON Formatter, JSON to CSV, Markdown to HTML Converter, Base64 Encode/Decode.