YAML ↔ JSON Converter
Convert YAML to JSON and back with a button or Ctrl+Enter, with error positions shown.
The left box is YAML and the right is JSON. Paste into the side you want to convert and press a direction button to fill the other. js-yaml 4.1.0 parses it; only its file is downloaded from a CDN on first load, and your config stays in the page.
| YAML | JSON |
|---|---|
# a comment | dropped |
age: 30 | "age": 30 |
zip: "12345" | "zip": "12345" |
roles: then - admin | "roles": ["admin", "developer"] |
description: | and three lines | one string with \n between lines |
Going from JSON back to YAML keeps structure and values but comments do not return. Typing does not convert; press a button or Ctrl+Enter (Cmd+Enter on Mac). With auto-detect on, pasting is enough to detect the format.
Unquoted values are typed, so version: 1.10 becomes 1.1 and 2026-11-29 becomes a date. Quote them as "1.10" to keep the text. js-yaml 4 follows YAML 1.2, so yes, no, on and off stay strings. Aliases (*) are expanded to their values, and the reverse direction writes no anchors.
Errors show in a red box with the line and column. An indentation error on a file that looks fine usually means a tab, since YAML indents with spaces only. A file with several documents split by --- must be pasted one document at a time, and JSON rejects a comma after the last item.