JSON to YAML Converter

Turn JSON into YAML 1.2 for config files. true and false stay booleans; the word yes stays text.

JSON for programs, YAML for people editing config

YAML is easier to diff and to comment by hand, which is why Docker Compose, GitHub Actions and Kubernetes use it. This page emits YAML 1.2. Booleans are true and false. The word yes is not a boolean. That matches current parsers and avoids the old surprise where a country code or a feature flag called yes turned into true.

How to use it

  1. Paste one JSON value: an object, an array, or a scalar.
  2. Pick an indent of 2 or 4 spaces. The result uses spaces, not tabs, because mixed indentation is the most common YAML bug.
  3. Sort keys only when you want a stable diff. Leave it off when the key order is part of the document.
  4. Copy the YAML into the config file. If you need JSON again, use YAML to JSON. Comments you add later will not survive that round trip.

Questions

Why are some strings quoted?

Values that look like booleans, numbers, dates, or that contain : # or leading spaces are quoted so a parser cannot reinterpret them.

Can I keep comments from my old file?

Not on this direction. JSON has no comments, so there is nothing to keep. Add comments after you paste the YAML.