JSON to YAML converter

Convert JSON to YAML or YAML to JSON. Broken JSON is marked and fixed in one click, and values that different YAML parsers would read differently are quoted or flagged.

JSON
YAML
Waiting for input

JSON vs YAML

JSONYAML
{
  "name": "api",
  "replicas": 3,
  "ports": [80, 443],
  "env": { "DEBUG": false }
}
name: api
replicas: 3
ports:
  - 80
  - 443
env:
  DEBUG: false

YAML uses indentation instead of brackets, and quotes are optional. That makes it pleasant to write by hand, and easy to get subtly wrong.

Values that change meaning

Unquoted YAML values are guessed. The guesses differ between YAML 1.1 (PyYAML, Ruby, older Kubernetes tooling, many CI systems) and YAML 1.2. Converting YAML to JSON, the converter warns you about each risky value at its exact position:

Unquoted valueYAML 1.2 readsYAML 1.1 reads
no, on, yTextBoolean
0121210 (octal)
22:30Text1350 (base 60)
1.101.11.1
2026-11-13TextA date object
12345678901234567890A number too big for JSON to keep exactly

Converting JSON to YAML, turn on Safe for YAML 1.1 and any string that could be misread is quoted, so the YAML means the same thing to every parser.

Common YAML errors

  • Tabs for indentation. YAML only allows spaces.
  • Inconsistent indentation, so an item ends up under the wrong parent.
  • No space after a colon: key:value is one string, not a key and value.
  • Duplicate keys, where the last one silently wins in many parsers.
  • Unquoted special characters like : or # inside a value.

Each is marked where it happens, in plain English, not as a parser stack trace.

Need JSON in another shape? Try JSON to CSV or JSON to TypeScript, or tidy it up with the JSON formatter.

Questions people ask

Is every JSON file valid YAML?
Almost. YAML 1.2 is designed as a superset of JSON, so a YAML parser can read most JSON as it is. The converter still turns it into idiomatic block-style YAML, which is easier to read and edit.
What is the Norway problem?
In YAML 1.1, unquoted no, yes, on and off are booleans, so a list of country codes containing NO turns Norway into false. YAML 1.2 fixed this, but PyYAML, Ruby and many tools still use 1.1. With “Safe for YAML 1.1” on, the converter quotes these values.
Why did my version number change from 1.10 to 1.1?
Unquoted, 1.10 is a number in YAML, and numbers lose trailing zeros. Quote version numbers: version: "1.10". When converting YAML to JSON, the converter warns you about values like this.
What happens to YAML comments and anchors?
JSON has no comments, so they’re dropped. Anchors and aliases (&name, *name) and merge keys (<<) are expanded into full copies, because JSON can’t express references. The converter tells you when this happens.
Can I convert a file with several YAML documents?
Yes. Documents separated by --- become a JSON array with one item per document, as you’d get from kubectl get -o yaml output or a multi-resource manifest.
↑↓ move↵ openesc close