Skip to main content

JSON to YAML Converter

Convert JSON to clean block-style YAML. Handles nested objects, arrays and multi-line strings, tolerates JSON5-style comments and trailing commas, and runs entirely in your browser.

Input

Drop a file or browse
One file · text
Or

Output

YAML output
 
Was this helpful?

Guides

Paste JSON, get YAML. This free online JSON to YAML converter turns any JSON object, array or config file into clean, block-style YAML — the format Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Ansible playbooks and most modern config systems expect. Conversion happens as you type, with no upload and no sign-up.

How to use it

  1. Paste your JSON into the input box, or upload a .json file with the uploader — its contents drop straight into the editor.
  2. The YAML output appears instantly on the right, syntax-highlighted.
  3. Copy it, or download it as a .yml file ready to commit.

Nested objects become indented mappings, arrays become - sequences, and empty objects and arrays stay as {} and []. Numbers, booleans and null keep their types instead of turning into quoted strings, so the YAML is semantically identical to the JSON you started with.

Does it handle JSON with comments or trailing commas?

Yes. Strict JSON is parsed exactly as written. If it fails to parse, the converter falls back to a relaxed JSON5-style pass that accepts // and /* */ comments, trailing commas, single-quoted strings and unquoted keys — the same tolerance the original tool had. Comments are dropped in the output, since they aren't part of the data.

What happens to multi-line strings?

A string containing newlines is written as a YAML literal block scalar (|- or |) instead of a long escaped one-liner, which is what makes YAML pleasant to read for embedded scripts, certificates or SQL. Strings with trailing spaces or other whitespace that a block scalar would silently lose fall back to a quoted one-liner so nothing changes value.

When does it add quotes?

Only when it has to. A string is quoted if it would otherwise be re-read as something else — "true", "null", "42", "yes", an empty string, anything with leading or trailing whitespace, a leading indicator character (-, [, {, #, *…) or a structural : or #. Everything else is emitted plain, so the result reads like YAML a human wrote.

Can I convert YAML back to JSON?

Yes — use the YAML to JSON converter. The two are inverses: JSON converted here and fed back through it returns the same structure.

Is my data private?

Completely. The conversion runs in your browser with a pure JavaScript parser and serializer. Your JSON is never sent to a server, never logged and never stored — so it's safe for config files that contain hostnames, keys or other internal details.

Why convert JSON to YAML at all?

YAML is a superset of JSON that trades braces and quotes for indentation, adds comments, and is far easier to review in a pull request. Teams often prototype with JSON (because that's what an API returns) and then commit the YAML form. This converter is the bridge.

jsonyamlconverterconfigdeveloper

Part of a workflow

All collections

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.