YAML → JSON
Convert YAML data to JSON format.
About YAML to JSON Conversion
Converting YAML to JSON is essential when working at the boundary between configuration and code: parsing Kubernetes manifests programmatically, ingesting GitHub Actions workflows into automation scripts, processing Ansible inventory files with APIs, or migrating configuration formats. JSON is the universal intermediate format that every programming language and tool understands natively.
YAML Syntax Quick Reference
YAML documents use indentation (2 spaces by convention) to express hierarchy. Key-value pairs are written as key: value. Lists use the - item notation. Inline syntax also works: {key: value} for objects and [item1, item2] for lists. The optional --- document separator marks the start of a document.
Type coercion is one of YAML's most important (and sometimes surprising) behaviors. Unquoted values are automatically typed: true/false/yes/no/on/off become booleans; integers and floats are parsed as numbers; null/~ become null. Strings that look like numbers or booleans must be quoted to preserve their string type. YAML also supports multi-document files (separated by ---) and anchors/aliases (&anchor, *alias) for value reuse across the document.