LazyTools

🔒 Every tool runs in your browser — the files and values you enter are never uploaded to any server. How it works

📝 JSON to YAML Converter

Paste JSON, get equivalent YAML — the format Kubernetes, GitHub Actions and docker-compose expect.

converted with js-yaml

Rate this tool:
Anonymous — no account, no identifier

How the json to yaml converter works

The JSON is parsed (with line/column errors if invalid), then serialized by js-yaml — the de-facto standard YAML library — producing block-style YAML with sensible quoting. Every JSON document is valid YAML semantically, so the conversion is lossless.

The everyday use is configuration: an API response or JSON config that needs to become a Kubernetes manifest, GitHub Actions step or docker-compose fragment. Since YAML relies on indentation, converted output is also a quick way to get canonically indented config from messy hand-written JSON.

Frequently asked questions

Is JSON to YAML always lossless?

Yes — YAML is a superset of JSON, so every JSON value has an exact YAML representation. The reverse direction can be lossy only for YAML-exclusive features (anchors, comments).

Why are some strings quoted in the output and others not?

js-yaml quotes only where YAML requires it — strings that would otherwise parse as numbers, booleans (yes/no/on/off) or contain special characters. Unquoted output is safe.

Does it handle deep nesting?

Yes — nesting converts to indentation levels without depth limits. Very wide values wrap at 100 characters for readability.

Can I convert a whole file?

Use the open-file button, convert, then download — no size caps, all local.

Is my config data private?

Yes — configs often contain hostnames and secrets, which is exactly why this runs entirely in your browser.

Related file converters

From the blog