Yuzool

Dev Tools

YAML to JSON converter

Paste YAML to get JSON, or JSON to get YAML. If the YAML is broken, you get the line and column and the reason, which makes this a quick YAML validator too.

YAML gotchas

  • Indent with spaces, never tabs.
  • A colon needs a space after it: key: value, not key:value.
  • Unquoted yes, no, on and off are true or false in older YAML (1.1) tools, and NO can turn Norway’s country code into false. Quote them to be safe.
  • Leading zeros and version numbers such as 1.10 can become numbers: quote "1.10" to keep it as text.

Several documents

A file with --- between parts holds several YAML documents (common in Kubernetes). They come out as a JSON list, one entry per document.

How to use it

  1. Pick YAML → JSON or JSON → YAML.
  2. Paste or open the file.
  3. Copy or download the result, or fix the line the error points to.

Questions

Is YAML a superset of JSON?

Almost: valid JSON is valid YAML 1.2, so JSON → YAML always works, and YAML that only uses JSON’s types converts back cleanly.

What happens to comments?

They’re dropped: JSON has no comments, so YAML → JSON can’t keep them.

Is my file uploaded?

No. It’s converted in your browser with the open-source js-yaml library.

Related tools

Open all 35 Dev Tools. Everything runs in your browser; nothing you paste is uploaded.

Settings

History

Snippet