JSON to YAML
input.json
output.yaml
The YAML appears here.
or drop a .json file into the left pane
What the output looks like
YAML is a superset of JSON, so every document converts. Objects become mappings, arrays become block sequences, and scalars keep their type:
{"service": "api", "ports": [80, 443], "env": {"TIER": "prod"}}
service: api
ports:
- 80
- 443
env:
TIER: prodThe three settings that matter
- No line folding. A long string stays on one line. Folded YAML looks tidier but re-joins with spaces on parse, which quietly corrupts URLs and commands.
- No anchors. Shared references are duplicated instead of aliased. Anchors are legal but poorly supported downstream, and they make a config harder to read than the repetition they save.
- JSON-compatible scalars. Ambiguous values are quoted. This is theNorway problem: in YAML 1.1,
noparses asfalse, so an unquoted country code silently becomes a boolean. Quoting removes the trap.
Where this is useful
Most tooling emits JSON while most configuration is written in YAML. Converting is the usual bridge when you are turning an API response into a fixture, moving a package.jsonfragment into a CI pipeline, or writing a Kubernetes manifest from a control-plane response.
Round tripping
YAML to JSON reverses this, and the round trip is lossless for anything JSON can express — comments are the exception, since JSON has nowhere to keep them. To check that a conversion changed nothing, run both versions through theJSON diff.
Common questions
Why are long strings not wrapped?
Line folding is turned off deliberately. Folded YAML re-joins with a space when parsed, which is fine for prose and wrong for a URL, a base64 blob, or a shell command. Leaving long values on one line means what you read is what the parser sees.
What happened to anchors and aliases?
They are disabled. If the same object appears twice in the JSON, it is written out twice rather than becoming &anchor and *alias. Anchors are valid YAML but many consumers — including some Kubernetes tooling — either reject or mishandle them.
Is the YAML safe to paste into a Kubernetes manifest?
Yes. The output is YAML 1.2 in JSON-compatible mode: strings that could be read as numbers, booleans, or dates are quoted, so a version like 1.10 or a value like no does not change meaning when the manifest is applied.
Can I control the indentation?
Use the Indent control in the toolbar. YAML requires spaces — tabs are illegal as indentation in YAML — so choosing Tab falls back to four spaces rather than producing a file no parser will accept.
The rest of the toolkit
Same engine, same privacy — every page runs entirely in your browser.
JSON formatter
Indent JSON with 2 spaces, 4 spaces, or tabs, then copy or download the result.
JSON viewer
Expand, collapse, and search a JSON tree; copy any value or its path.
JSON validator
Find syntax errors with exact line, column, and a suggested fix.
JSON minifier
Strip whitespace and see the byte savings before and after.
JSON beautifier
Turn minified or broken JSON into clean, highlighted output.
JSON pretty print
Readable indentation with optional deep key sorting.
JSON to CSV
Flatten an array of objects into spreadsheet rows, quoted correctly.
CSV to JSON
Parse CSV — quotes, embedded commas, any delimiter — into JSON records.
YAML to JSON
YAML 1.2 parsing, multi-document streams, errors reported by line.
JSON to XML
Arrays repeat their tag; @keys become attributes.
XML to JSON
Entities, CDATA, and namespaces handled by the browser’s XML parser.
JSON diff
Compare two documents by path — key order and indentation are ignored.