tools.now

JSON to YAML Converter

Paste JSON to get the same data as YAML, ready for a Kubernetes manifest, a Docker Compose file or a CI config. Invalid JSON is reported with its line and column.

Output

🔒 Runs in your browser. Your data is never uploaded.

How to use

  1. Paste your JSON into the input box.
  2. Choose 2 or 4 spaces of indentation.
  3. Copy the YAML into your config file.

Quoting is handled for you

A JSON string such as "true", "123" or "null" would change type if written bare in YAML, so it is emitted in quotes. Strings containing line breaks become block scalars, which are much easier to read than \n escapes.

Frequently asked questions

Is the key order preserved?
Yes. Keys are written in the order they appear in the JSON; nothing is sorted.
Can I add comments to the result?
Yes. YAML supports comments starting with #, which JSON does not. Add them after converting.
Why did a very large number change?
JSON numbers are read as 64-bit floats, so integers above 9,007,199,254,740,991 lose precision before conversion. Store such IDs as strings.

Related tools