Promptyard
JSON

JSON ↔ YAML

Convert between JSON and YAML losslessly, preserving scalar types and structure.

JSONYAML

How it works

Powered by eemeli/yaml, the de facto JS YAML parser. Both directions are lossless for spec-conforming input — every JSON document round-trips through YAML and back.

FAQ

Why convert at all?
YAML is friendlier for humans (Kubernetes manifests, GitHub Actions, CI configs). JSON is friendlier for machines (APIs, configs that ship in code). Most teams keep both flavours of the same data.
Are floats / booleans / nulls preserved?
Yes. The YAML parser respects scalar types when they're unquoted — true, 1.5, null. Quoting forces strings.
Does this handle YAML anchors / aliases?
Yes when YAML → JSON (anchors expanded). JSON → YAML doesn't introduce anchors; output is a plain tree.
What about YAML 1.1 vs 1.2?
The yaml npm package targets 1.2 by default — meaning no/off are NOT booleans, only true/false are. Most modern tools use 1.2.

Related tools