datapry

JSON to YAML

Convert JSON to clean YAML, quoting strings that YAML would otherwise misread. Runs in your browser, so nothing is uploaded.

Indent

JSON input

YAML output

Waiting for input

About this tool

Turn JSON into readable YAML for configuration files and manifests. Strings that YAML would otherwise read as other types, such as "true" or "1", are quoted so their meaning doesn't change, and you can choose the indentation and sort keys.

How to use it

  1. Paste JSON or import a file.
  2. Choose indentation and key sorting.
  3. Copy or download the YAML.

Example

Input
{"service":"api","debug":"false","ports":[8080,8443]}
Output
service: api
debug: "false"
ports:
  - 8080
  - 8443

The string "false" stays quoted so it isn't read as a boolean.

Questions

Is any data lost going from JSON to YAML?
YAML can represent everything in JSON. The one exception is numbers too large for JavaScript, which are flagged with a warning, and duplicate keys, which are also flagged.
Does it work for Kubernetes manifests?
It produces standard YAML that Kubernetes can read. This tool checks syntax only, so it won't tell you if a manifest is valid for the Kubernetes API.
Can I convert back?
Yes. Use the YAML to JSON tool. Data round-trips cleanly, apart from key order if you chose to sort keys.