jsonecho

JSON to YAML

Convert JSON to readable YAML for config files, Kubernetes manifests and CI pipelines.

Loading the tool...

How to use JSON to YAML

  1. Paste JSON, for example an OpenAPI document or a Kubernetes manifest in JSON form.
  2. Choose a 2 or 4 space indent.
  3. Copy the YAML into your config file.

About JSON to YAML

YAML is a superset of JSON in practice, which means every JSON file can be expressed as YAML. The difference is readability: no braces, no quotes around most strings, and indentation instead of punctuation. That is why Kubernetes, Docker Compose, GitHub Actions, Ansible and OpenAPI all lean on it.

The converter writes block style YAML. Strings are only quoted when they have to be, for instance when they look like numbers or booleans, so "true" stays a string and does not turn into a boolean on the other side.

Frequently asked questions

Will strings like "yes" or "no" stay strings?

Yes. They are written with quotes so that parsers following the older YAML 1.1 rules do not read them as booleans. The same applies to values like "1.0" or "null".

Are comments preserved?

JSON has no comments, so there is nothing to carry over. You can add them in the YAML file afterwards.

Can I convert YAML back to JSON?

Yes, with the YAML to JSON tool. A round trip gives you the same data.

Why is my long string on one line?

Line folding is switched off, so long values stay on a single line. That avoids surprising line breaks in generated files.

More in Converters

All tools →