JSON to YAML

Convert JSON to clean, readable YAML.

0 chars
0 words
0 lines
0 chars
0 words
0 lines

JSON to YAML Converter Online

The JSON to YAML converter transforms JSON into clean, human-friendly YAML. Braces and brackets disappear, nesting is shown by indentation, lists use dashes, and quotes are kept only where they're needed to preserve the data type. Paste JSON and copy YAML — no install, no upload.

Why YAML?

YAML is the configuration language of modern infrastructure: Kubernetes manifests, Helm charts, Docker Compose files, GitHub Actions and GitLab CI pipelines, Ansible playbooks, OpenAPI specs, and countless app configs. Many tools export or accept JSON, but humans prefer to read and maintain YAML. Converting is lossless: YAML 1.2 is a superset of JSON, so the data is exactly the same.

Safe by default

YAML has a few famous pitfalls — the "Norway problem" where NO becomes false, version numbers like 1.10 turning into 1.1, or strings containing : breaking the structure. The converter uses the maintained yaml library, which automatically quotes any string that would otherwise change meaning. Numbers, booleans, and nulls stay unquoted and keep their types.

Options

  • Indentation – 2 spaces (the most common convention) or 4 spaces.
  • Quote all strings – writes every string in double quotes, useful when a downstream tool uses an older YAML 1.1 parser.

Example

{"name": "web", "ports": [80, 443], "tls": true} becomes:

name: web
ports:
- 80
- 443
tls: true

Need the other direction or other formats? Convert with JSON to XML, TOML to JSON, or format the source first with the JSON Beautifier.

Frequently Asked Questions

Since YAML 1.2, yes: every valid JSON document is also valid YAML. Converting to YAML's block style simply makes the same data easier to read and edit by removing braces, brackets, and most quotes.

Strings that YAML would otherwise read as something else keep their quotes: "yes", "no", "true", "null", numbers like "1.10", and text containing ": " or starting with special characters. That keeps the data identical after conversion.

Yes. Paste the JSON (for example from kubectl get -o json) and you get YAML in the usual block style, with lists written as dashes, ready for a manifest file.

No. JSON has no comments, so there's nothing to carry over. You can add YAML comments (#) to the output by hand.