Monitoring
Solutions
Resources
Free Tools
Pricing
Free Tools / Converters / JSON to YAML Converter

JSON to YAML Converter

Paste JSON and get YAML you can drop into a manifest or a config file. Strings that YAML would misread — "yes", "0123", "a: b" — are quoted for you.

Runs entirely in your browser — nothing you enter here is sent to a server.

From JSON to YAML

JSON and YAML describe the same things — maps, lists, strings, numbers, booleans and null — so any JSON document has an exact YAML equivalent. YAML drops the braces, brackets and most quotes and shows structure through indentation instead, which is why it became the format for files that people edit by hand: Kubernetes manifests, Docker Compose, GitHub Actions, Ansible playbooks, OpenAPI specifications.

The converter writes block-style YAML with two-space indentation and keeps the order of your keys. Its main job beyond reformatting is deciding where quotes are still needed, because unquoted YAML guesses types — and guesses wrong surprisingly often.

Strings that look like something else

"yes", "no", "on", "null", "1.0" and "0123" stay quoted, so they remain strings and do not turn into booleans or numbers.

Special characters

Values containing : , #, or starting with -, *, &, { or [ are quoted, because YAML would read them as syntax.

Multi-line text

Strings with line breaks are written as literal blocks (|), which is far easier to read than \n escapes.

Empty values

Empty arrays and objects are written as [] and {}, and null as null, so nothing is lost on the way back.

When you need this

The usual case is an API that returns JSON while your tooling wants YAML: kubectl get … -o json output that should become a manifest in Git, a JSON Schema you want inside an OpenAPI file, a generated configuration that a human now has to maintain. Since YAML 1.2 is a superset of JSON, pasting JSON straight into a YAML file is technically valid — but nobody will thank you for it in code review.

Frequently asked questions

Is YAML a superset of JSON?

YAML 1.2 is: every valid JSON document is also valid YAML. The reverse is not true — YAML has comments, anchors and multi-line strings that JSON lacks.

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

Quotes are added only where YAML would otherwise change the meaning: values that look like booleans, numbers or null, and values containing characters that are YAML syntax. Everything else is left plain for readability.

Does the conversion keep the order of keys?

Yes. Keys are written in the order they appear in the JSON. Neither format gives order a meaning, but keeping it makes diffs readable.

Is my data uploaded?

No. The conversion runs in your browser, so manifests and configs with secrets never leave your machine.

Related free tools

A calculator answers once. Monitoring answers every minute.

Upzilla checks your sites, servers and APIs around the clock and alerts you the moment something breaks. 10 monitors free, no card required.

Start monitoring free →