ComfyToolkit

Data Converter

Convert between JSON, YAML, TOML and CSV.

Input
1
Output
1

JSON to YAML Converter

Turn a JSON document into YAML, usually because the destination is a Kubernetes manifest, a CI pipeline definition or an application config where humans do the editing.

This page opens with JSON selected as the input and YAML as the output.

What you gain and what you lose

YAML gives you comments, which JSON has no syntax for, and a less punctuation-heavy shape that is easier to hand-edit. That is the whole reason config ends up in YAML.

You lose unambiguity. JSON types are explicit; YAML infers them, and the inference has famous edge cases. Anything that must stay a string after conversion is worth quoting deliberately.

Values that change meaning

YAML 1.1 reads a set of bare words as booleans, so a country code of NO becomes false and a value of ON becomes true. A version string of 1.20 becomes the number 1.2 and loses its trailing zero. A git SHA that happens to be all digits with an e in the middle can be read as scientific notation.

{"country":"NO","version":"1.20"}

country: NO      ← now a boolean
version: 1.20    ← now the number 1.2

Indentation rules

Tabs are forbidden as YAML indentation - an editor that inserts one produces a file that will not parse, and the error rarely points at the tab. Output here uses spaces consistently.

Multi-line strings become readable

A long string with embedded newlines is one unreadable line in JSON. YAML block scalars using a pipe preserve those newlines while letting the text lay out normally, which is the main readability win when moving certificates, scripts or templates into config.

The distinction between the pipe and the greater-than form matters: the first keeps newlines, the second folds them into spaces.

Open the full Data Converter