YAML to JSON converter
Convert YAML to JSON or back, with line-accurate errors. Great for Kubernetes, Docker Compose and CI configs.
YAML gotchas
- Indentation is meaningful, and tabs are not allowed. Use spaces.
- The "Norway problem": in older YAML 1.1 parsers, unquoted
no,yes,onandoffbecome booleans. This converter uses the YAML 1.2 core schema, where onlytrueandfalseare booleans, but other tools may differ. Quote values to be safe. - Leading zeros:
010may be read as a number; quote version numbers and postcodes. - Multiple documents separated by
---are converted to a JSON array.
Private
Everything runs in your browser. Nothing you paste is uploaded, logged or stored on a server.
Conversion uses the open-source js-yaml library.
Questions
Is JSON valid YAML?
Almost always, yes. YAML 1.2 is a superset of JSON, so most JSON documents are also valid YAML.
Are YAML comments kept?
No. JSON has no comments, so comments are dropped when converting to JSON.