Skip to content

Convert JSON to YAML

This tool converts JSON to YAML in your browser, for a Kubernetes manifest, a Docker Compose file or a CI pipeline that reads YAML. The result is written as block style YAML with an indent of two spaces, keys keep the order they had in the JSON, and a long string is never folded across lines; a multi-line string becomes a block scalar instead. A value that an older YAML reader (YAML 1.1, such as PyYAML or an older Docker Compose) would read as something else, such as no, on, yes, 08, 1.10, true or a date, is quoted, so the file means the same everywhere. Your file is never uploaded.

Runs in your browser

Drop a file here

JSON, up to 50 MB

How it works

  1. 1 Choose a JSON file.
  2. 2 GRID16 parses it and writes YAML in your browser.
  3. 3 Download the YAML file.

Questions

How is the YAML formatted?
As block style with an indent of two spaces. Keys keep the order they had in the JSON, and a long string is never folded across lines.
What happens to a multi-line string?
It becomes a literal block scalar, the YAML form that starts with |, so each line of the string stays a line of its own instead of an escaped \n.
Why are some values quoted?
Because an older YAML reader (YAML 1.1, such as PyYAML or an older Docker Compose) would read them as something other than a plain string: no, on, yes, 08, 1.10, true and a date such as 2024-01-01 are quoted, so the file means the same to every reader.
What happens with invalid JSON?
The job stops and says why.
Is my file uploaded to a server?
No. The conversion happens in your browser; the file never leaves your device.