JSON to YAML Converter

Turn JSON into clean, readable YAML for config files and docs.

How to use

What it checks and how it works

The JSON is parsed with the browser's JSON parser (RFC 8259) and written out with the yaml library as YAML 1.2. Strings that would be read as another type, such as "true", "null" or "123", are quoted so they round-trip back to the same JSON, and Arabic text is written as it is. JSON-to-YAML conversion is lossless for data, but the layout is the library's: key order is kept, comments never existed in JSON, and long strings may be folded across lines. Convert back with the YAML to JSON tool to check a result.

Will the YAML give back exactly my JSON?

Yes for the data. Types and key order are kept, and strings that look like numbers or booleans are quoted to stay strings.

Why are some strings in quotes?

YAML would otherwise read them as another type, such as a number, a boolean or null. The quotes keep them as text.

Can I choose block or flow style?

The tool writes the block style that config files use. It does not offer the compact flow style.

Sources

Related tools

Privacy

Runs in your browser; nothing is uploaded. The interactive tool needs JavaScript.