JSON ↔ YAML Converter

Two-way conversion: turn JSON into YAML, or YAML into JSON. A perfect fit for Kubernetes and CI configs.

Runs 100% in your browser — your data is never sent to a server.

What Is YAML, and How Is It Different from JSON?

YAML ("YAML Ain't Markup Language") is a data serialization format that expresses data using indentation and whitespace rather than curly braces and quotation marks, making it much easier for humans to read and edit by hand than JSON. In fact, every valid JSON document is also a valid YAML document — YAML was designed as a superset of JSON; but when written in its own native style, it offers comment lines (#), multi-line text, and a simpler syntax.

Its most obvious difference from JSON is comment support — you can add a note explaining why a configuration value is set the way it is in YAML, which isn't possible in JSON. The syntax is simpler too: an array like JSON's {"tools": ["json", "yaml"]} is written in YAML as a list of items each prefixed with a dash (-) on its own line, and quotation marks become optional in most cases. On the other hand, because YAML relies so heavily on indentation, it's more prone than JSON to invisible mistakes like mixing tabs and spaces — even a single space out of place on a line can change the meaning of the file.

YAML has become the de facto standard for configuration files: Kubernetes' Deployment/Service/ConfigMap manifests, Docker Compose's docker-compose.yml file, CI/CD pipeline definitions like GitHub Actions and GitLab CI, Ansible playbooks, and the settings files of countless applications (config.yaml) are all written in YAML. Taking JSON output from an API or a program and converting it into a configuration file usable by these tools — or doing the reverse — is a need developers run into often.

This tool performs both directions of the conversion entirely in your browser using the js-yaml library; even when converting a configuration file that may contain sensitive data like API keys or database connection strings, nothing is ever sent to a server or stored. You can copy the converted result to the clipboard with one click, or download it directly as a .json/.yaml file.

Try This Next

Finished here? These might be your next step.

Frequently Asked Questions

No. Since JSON has no concept of comments, they're lost during YAML → JSON conversion; this is a limitation inherent to the formats themselves.

The YAML 1.2 standard is supported (via the js-yaml library). Modern tools like Kubernetes, Docker Compose, and GitHub Actions all use this standard.

Actually, the opposite is true: every valid JSON document is also valid YAML, because YAML was designed as a superset that includes JSON's syntax. When you convert a file written in YAML's own native syntax (indented, with comments) to JSON, the comments and formatting are lost, because JSON has no syntax to represent them.

Only spaces. The YAML standard doesn't accept the tab character for indentation — using a tab in a YAML file causes an outright error in most parsers. Keeping your editor's "insert spaces instead of tabs" setting enabled prevents the most common mistake when working with YAML files.

The most common causes are inconsistent indentation levels (a child item not starting with the same number of spaces as its siblings), a missing space after the dash (-) that starts a list item, or a text value containing a colon (:) without being quoted. The line/column information in the error message points to the exact problem spot.

Yes. Multi-line text written using YAML's | (which preserves line breaks) and > (which folds lines into a single paragraph) block scalar styles is correctly converted into a single JSON string value (with line breaks as \n characters); in the JSON → YAML direction, long text containing line breaks is automatically written in a readable block format as well.

Last updated: