YAML Formatter
Format, validate, and convert YAML. Switch between YAML and JSON instantly. Supports nested objects, arrays, multi-line strings, booleans, and numbers.
About This Tool
This YAML formatter handles the most common YAML patterns: key-value pairs, nested objects (via indentation), arrays (- items), quoted and unquoted strings, numbers, booleans, null, comments, and multi-line strings (| and >). For advanced YAML features (anchors, tags, complex keys), use a dedicated YAML library.
Raw YAML (YAML Ain't Markup Language) — a human-readable data serialization format using indentation for structure
YAML text parsed into a JavaScript object tree — key:value pairs, nested objects (indentation), arrays (- prefix), and scalar types
Structure checked for consistent indentation, valid syntax, and proper nesting — errors reported with line context
Bidirectional YAML ↔ JSON conversion — YAML's indentation maps to JSON's braces and brackets
Output re-serialized with consistent indentation (2 or 4 spaces) and sorted keys if requested
Spec: YAML 1.2 (yaml.org), RFC 9512 (YAML Media Type), ECMA-404 (JSON)