TXT · Text & Data tools

JSON to YAML Converter

Input · JSON
Output · YAML
0 Bin0 Bout0lines in0keysEmptyJSON
Go to the full Data Format Converter

JSON to YAML

Convert JSON to YAML. Paste JSON on the left; the YAML output builds on the right as you type.

{ "name": "vayce", "tools": 224, "categories": ["images", "text-and-data"], "active": true }

becomes

name: vayce
tools: 224
categories:
  - images
  - text-and-data
active: true

JSON’s {} and [] map to YAML’s block-style mappings and sequences. Since every JSON document is already valid YAML by the spec, this direction never fails on well-formed input; the only real choice is indentation.

Indentation

YAML’s structure comes entirely from indentation, so the Indent control (2 or 4 spaces) changes how nested keys and array items line up. There’s no tab option: YAML explicitly disallows tabs for indentation, unlike JSON or XML where a Tab option exists.

Comments and key order

JSON has no comments, so there’s nothing to preserve on this side of the conversion, unlike YAML to JSON where existing YAML comments get dropped. Key order in the output follows the key order in the source JSON object; nothing gets alphabetized unless you convert through the JSON formatter’s Sort keys option first.

Chained conversions

Because this converter always passes through a JSON value internally, converting JSON to YAML and then swapping to YAML to XML on the same page produces the same XML you’d get from converting the original JSON to XML directly. Use whichever pair matches the page you landed on; the result doesn’t depend on which detour you took.

Frequently Asked Questions

No. Every valid JSON value, including nested objects, arrays, numbers, strings, booleans, and null, has a direct YAML equivalent, so nothing is dropped or renamed in this direction.

2 spaces by default, matching most style guides. Switch to 4 spaces with the Indent control if your project's YAML linter expects it.

The YAML serializer only quotes a string when it needs to: values that would otherwise parse as a number, boolean, null, or that contain characters like a colon-space sequence that YAML treats as syntax.

Yes. A top-level JSON array becomes a YAML sequence, with each item on its own line prefixed by a dash, no wrapping key required.

Swap the input and output formats, or open the YAML to JSON converter directly. The swap button also copies the current output into the input pane so you can round-trip in place.

Jump straight to a conversion

Full Data Format Converter tool

Explore Our Tools

Browse all tools