JSON to YAML

Convert JSON into readable YAML: quotes only where they are needed, block scalars for multi-line strings, and sequences written the way people write them.

json
YAMLyaml
The result appears here

Questions

When does a value get quoted?+

Only when it would otherwise be read as something else: an empty string, one with leading or trailing space, one starting with a YAML indicator, or one that looks like a number, a boolean or null. Quoting everything is valid YAML and unreadable.

What happens to multi-line strings?+

They become a block scalar with |-, which keeps the line breaks visible instead of turning them into \n inside a quoted string. That is the form that makes a script in a config file reviewable.

Is the conversion lossless?+

In this direction, yes: YAML is a superset of JSON, so every value has a form here. Going back the other way is where YAML features such as anchors and multiple documents have no JSON equivalent.

Related tools

The tools are free. So is most of the library.

1935 blocks and 989 pieces for shadcn/ui and Tailwind, built on the same tokens these tools write. Install one with a command and the code is yours.

No signup for the tools. MIT for free blocks, commercial licence for Pro.

Markdown version