What is YAML?
YAML is a configuration format that uses indentation instead of braces. Docker Compose, Kubernetes, GitHub Actions and Spring Boot's application.yml all use it. YAML 1.2 is a superset of JSON, so the two convert cleanly in both directions; the difference is mainly how readable they are.
How to use
- Choose the direction: JSON → YAML or YAML → JSON.
- Paste your content. With auto convert on, the result appears as you type, and syntax errors point to the exact line and column.
- Pick 2 or 4 spaces of indentation, then copy or download the result. "Use result as input" converts it back the other way.
Example
This JSON:
{"name":"web","replicas":3,"ports":[80,443],"env":{"DEBUG":"yes","VERSION":"1.10"}}
becomes:
name: web replicas: 3 ports: - 80 - 443 env: DEBUG: "yes" VERSION: "1.10"
Note the quotes around "yes" and "1.10". Without them, many YAML tools would read yes as the boolean true and 1.10 as the number 1.1, silently changing your configuration.
FAQ
Why are some values in quotes?
Strings that YAML could misread are always quoted: words such as yes, no, on and null, anything that looks like a number or a date, and text containing : or #. A famous example is the country code NO (Norway), which older YAML parsers turn into false.
Are big numbers kept exactly?
Yes, in both directions. A value such as 9007199254740993 or 1280.50 is written exactly as in the source. Many online converters pass numbers through JavaScript and round large IDs to 9007199254740992.
What happens to comments, anchors and multiple documents?
JSON has no comments, so YAML comments are dropped. Anchors and aliases (&base, *base) and merge keys (<<: *base) are expanded into their values. A file with several documents separated by --- becomes a JSON array.
How are dates handled?
Dates like 2024-01-01 are kept as the same text in JSON. They are not converted to another format or time zone.