JSON to YAML Converter

Convert JSON to clean, readable YAML — or switch the mode to turn YAML back into JSON. Powered by the widely used js-yaml parser.

YAML output
Ctrl + Enter to run

Runs 100% in your browser — your data is never uploaded to our server.

JSON and YAML, both directions

YAML is the configuration language of Kubernetes manifests, Docker Compose files, GitHub Actions, Ansible playbooks and OpenAPI specs. It represents the same data as JSON — objects, lists, strings, numbers, booleans and null — but uses indentation instead of braces, which makes it easier for people to read and edit. In fact every JSON document is also valid YAML 1.2.

In JSON → YAML mode the tool produces block-style YAML, quoting strings only when necessary (for example "yes", "1.0" or text containing :) so values keep their type. In YAML → JSON mode it reads full YAML: comments, multi-line strings (| and >), anchors and aliases, and flow collections. Switching the mode reuses the last result as the new input, so you can round-trip a file.

How to convert

  1. Choose the direction in Mode.
  2. Paste JSON or YAML (or upload a .json, .yaml or .yml file).
  3. Pick 2 or 4 spaces of indentation and copy or download the result.

Example

JSON

{
  "server": {"port": 8080, "tls": true},
  "features": ["auth", "billing"]
}

YAML

server:
  port: 8080
  tls: true
features:
  - auth
  - billing

Things to know

  • YAML comments are dropped when converting to JSON because JSON has no comments.
  • In YAML, unquoted yes/no are strings in YAML 1.2 (the version used here) but booleans in older YAML 1.1 tools — quote them if unsure.
  • Indentation must use spaces; tabs are not allowed in YAML.

Frequently asked questions

Is YAML a superset of JSON?

YAML 1.2 is designed so that valid JSON is also valid YAML, which is why converting JSON to YAML never loses data.

Why are my comments missing in the JSON output?

JSON does not support comments, so they cannot be carried over.

Can I convert Kubernetes multi-document YAML (---)?

This converter reads one document at a time. Split multi-document files at the --- separators first.

Is my config uploaded?

No. Conversion runs in your browser; the YAML library is served from this website.