YAML to JSON converter
Convert YAML configuration into strict JSON locally, useful for CI pipelines, Helm values, and OpenAPI specs.
Format pair conversion
YAML to JSON conversion notes
Use this YAML to JSON converter when a CI pipeline file, Kubernetes manifest, OpenAPI spec, or Helm values document needs to be turned into JSON for an API client, schema validator, or migration script. YAML is a strict superset of JSON so most documents map cleanly: scalars become JSON primitives, sequences become arrays, and mappings become objects. The page parses the YAML in the browser, normalizes block-style indentation into JSON braces, and gives you a copyable JSON document. It is especially handy when a tool only accepts strict JSON (for example a JSON Schema validator) and the source file is YAML.
Source
version: 2
services:
api:
image: ghcr.io/example/api:1.4
ports:
- 8080:8080
env:
LOG_LEVEL: infoResult
{
"version": 2,
"services": {
"api": {
"image": "ghcr.io/example/api:1.4",
"ports": ["8080:8080"],
"env": { "LOG_LEVEL": "info" }
}
}
}- Spec relationship
- Every JSON document is also valid YAML 1.2
- Type coercion
- Unquoted yes / no / on / off no longer become booleans in YAML 1.2 core schema
- Common pitfall
- Tab indentation is illegal in YAML; use spaces only
Source: YAML 1.2.2 specification, accessed 2026-05-06
FAQ
Is YAML a superset of JSON?
Yes. YAML 1.2 is intentionally a strict superset of JSON, so any valid JSON document is also a valid YAML document and round-trips through the converter cleanly.
How are YAML anchors and aliases handled?
Anchors (&name) and aliases (*name) are expanded inline during parsing so the JSON output contains the resolved value rather than a reference.
Why did my YAML 'yes' become a string in the JSON output?
YAML 1.2's core schema only treats true and false as booleans. Older YAML 1.1 booleans like yes, no, on, and off are parsed as strings to avoid silent truthiness changes.