Choose for the people editing it

JSON has a small grammar and predictable parsers. YAML is easier to scan in large configuration files but includes more syntax and type inference rules.

Where JSON fits best

JSON is a strong default for APIs, generated artifacts, package metadata and data exchanged across languages.

  • Universal parser support
  • Unambiguous braces and brackets
  • Straightforward schema validation
  • Reliable round trips

Where YAML fits best

YAML works well for configuration maintained by people: deployment manifests, automation workflows and settings with long block strings. Quote values that could be interpreted as dates or booleans, and validate after conversion.

Primary references

Read the specification

YAML Language Development TeamYAML Ain't Markup Language Version 1.2.2RFC Editor · RFC 8259The JavaScript Object Notation Data Interchange Format

Put the guide into practice

Open the related browser tools and test the workflow with a synthetic sample

JSON to YAML YAML to JSON