JSON to YAML Converter

Convert JSON to YAML 1.2, quoting ambiguous strings (yes, no, 0123…) so they keep their type. Warns about numbers other parsers may round.

Input

Up to 5 MiB. The file is not uploaded: it is read in your browser.

Ctrl + Enter to run

Result

Converts JSON to YAML 1.2 in block style. Strings that a YAML parser could read as another type —yes, no, on, off, null, 0123, 1.10 or dates— are quoted so the data does not change when read back, with both YAML 1.2 and legacy 1.1 parsers.

Numbers are copied as written in the JSON and you are warned when they are large enough for another parser to round them.

How to use it

  1. Paste the JSON.
  2. Press Run.
  3. Review the warnings and download the .yaml file.

Example

Example input
{"service":"api","replicas":3,"debug":false,"country":"NO","version":"1.10","env":{"LOG_LEVEL":"info","FEATURE_X":"yes"}}
Result
service: api
replicas: 3
debug: false
country: "NO"
version: "1.10"
env:
  LOG_LEVEL: info
  FEATURE_X: "yes"

Limitations

  • It does not generate anchors, aliases or comments.
  • JSON with duplicate keys is rejected because YAML 1.2 forbids them.
  • Multiline strings are written double-quoted with \n instead of literal | blocks.

FAQ

Why is "NO" quoted?
Because YAML 1.1 reads NO as false (the well-known “Norway problem”). Quoting it guarantees it stays text.
Is the result valid for Kubernetes or Docker Compose?
It is valid YAML equivalent to your JSON, but the tool does not validate those platforms’ schemas.

Related tools

References