JSON ↔ YAML Converter
Convert JSON to YAML and back. Handles nested objects, arrays, scalars, and multiline strings.
Use JSON ↔ YAML Converter
name: splitlight
version: 2
active: true
tags:
- tools
- dev
- free
owner:
email: "tim@splitlight.co.uk"
roles:
- admin
- editor
notes: |-
line one
line two
line threeJSON and YAML, two views of the same data
JSON and YAML describe the same building blocks — mappings (objects), sequences (arrays), and scalars (strings, numbers, booleans, null) — in two different styles. JSON leans on explicit punctuation: braces, brackets, commas, and quotes. YAML drops most of that in favour of indentation and is comfortable to read and hand-edit, which is why it became the default for configuration files in Docker Compose, Kubernetes, GitHub Actions, and countless other tools. Converting between them lets you author in whichever format suits the task and hand off in whichever format the consumer expects.
When to convert which way
Convert JSON to YAML when you want a cleaner, comment-friendly version of an API response or a generated config — YAML's indentation makes deeply nested data far easier to scan than walls of braces. Convert YAML to JSON when a tool, language, or API only accepts JSON, or when you need a strict, machine-parseable form for programmatic use. Because both formats map to the same structure, you can round-trip with the Swap & reverse button to sanity-check that nothing was lost, and to reformat messy input along the way.
Multiline strings and tricky scalars
Two things commonly trip up hand-written conversions: multiline text and values that look like other types. This converter handles both. Strings containing newlines are emitted using YAML's literal block style (|), which keeps every line break, and they are reconstructed exactly when going back to JSON. Strings such as true, 42, null, or anything starting with a special character are automatically quoted so YAML does not silently reinterpret them as a boolean, number, or null. The result is a conversion you can trust for real configuration files.
Frequently Asked Questions
Find this useful?
These tools are free and ad-free. Support the project!