JSON and YAML tools
Paste your JSON or YAML on the left. If it is valid, on the right you see it formatted and colored, or as a collapsible tree. If it has an error, the bar below tells you which line and column (click it to jump there).
Format indents it (choose 2, 4 spaces or a tab); Minify puts it on one line; Sort keys orders each object's fields alphabetically (handy for comparing two files). Copy and ⬇ take the result.
YAML
Input: auto reads valid JSON as JSON and anything else as YAML (text starting with { or [ stays JSON, so you see its JSON error); Input: YAML or Input: JSON force one. JSON and YAML above the output choose what comes out; YAML → JSON and JSON → YAML set both at once. Format and Minify rewrite the input in the output format.
YAML has pitfalls: things that read differently from how they look. The yellow strip lists them with their line (click to jump): unquoted yes/no/on/off (text in YAML 1.2, true/false in YAML 1.1), tabs in the indentation, mixed indentation, 010 or 1.10 that lose their shape, unquoted dates, several documents separated by --- (they become a list), and anchors and aliases (copied in JSON). A repeated key is an error. The YAML this page writes quotes everything ambiguous, so it has no pitfalls.
Tick JSONL for JSON Lines files (.jsonl, .ndjson): one JSON per line. Each line is validated and, if one fails, you are told which; on the right you see each record formatted with its line number. Minify keeps each record on its line without spaces; Format is disabled, because it would split the records. Unchecked, the text must be a single JSON or YAML.
Everything happens in your browser: your data never leaves this page. YAML is read with js-yaml (MIT), served from this site.