Back to Developer
YAML ⇄ JSON converter — indent preserved

YAML ⇄ JSON converter — indent preserved

Convert YAML to JSON or JSON to YAML. Choose indent (2 / 4 / tab) and try the sample button. Powered by eemeli/yaml — runs entirely in your browser.

developerJSONconversion

How to use

Pick a direction (YAML → JSON or JSON → YAML), paste your text, choose an indent (2 / 4 spaces, and Tab for YAML → JSON only), then press Run. We parse/emit via the YAML 1.2 compliant `yaml` library, so Japanese characters and emoji round-trip safely. Sample button preloads typical data. Copy or download the result as .json / .yaml.

FAQ

Is my input uploaded anywhere?
No. Conversion runs in your browser via local JavaScript — nothing leaves your device.
Which YAML version is supported?
YAML 1.2 (via the eemeli/yaml library). Anchors / aliases, multi-document streams, and both flow / block styles are supported.
Are YAML `yes` / `no` / `on` / `off` coerced to booleans?
Under YAML 1.2 they remain strings. Use `true` / `false` for actual booleans.
Why do JSON → YAML outputs quote some strings?
When a string value looks like a boolean literal (`true` / `false`) or a number, the `yaml` library quotes it to keep round-tripping unambiguous. That's correct behaviour.
Are comments preserved?
JSON has no comment syntax, so JSON → YAML can never produce comments. YAML → JSON drops comments because JSON cannot represent them.
Why merge YAML→JSON and JSON→YAML into one tool?
Both directions are the same concept. A direction toggle keeps them in a single UI. The indent options follow the active direction (Tab is only valid for JSON output).

Related tools