📋YAML to JSON Converter - Convert YAML ↔ JSON Online with Error Locations
Kubernetes manifests, docker-compose files, GitHub Actions workflows and Spring Boot configs are written in YAML, while APIs and code usually want JSON. Paste YAML to get formatted JSON, or paste JSON to get clean YAML. Parsing uses the mature yaml library with full YAML 1.2 support: multiple documents separated by --- (combined into a JSON array or emitted as JSON Lines), anchors & and aliases *, << merge keys, block scalars | and >, and every quoting style. Syntax errors point to the exact line and column with the offending line shown, and duplicate keys are reported too. When converting JSON to YAML you can choose the indent, sort keys, double-quote all strings, fold long strings at 80 columns and split a top-level array into separate YAML documents. Use result as input flips the direction in one click so you can verify a round trip.
Free · No sign-up · Runs in your browserLast updated:
How to use YAML to JSON Converter
- 1Choose YAML → JSON or JSON → YAML
- 2Paste your content and set indent, sorting and multi-document options
- 3Copy or download the result, or fix the error at the reported line and column
FAQ
- How are anchors and << merge keys handled?
- Content defined with an anchor &name is fully expanded wherever the alias *name appears. With merge keys enabled, the common docker-compose pattern <<: *common merges the shared mapping into the current one, with keys written locally taking precedence. The resulting JSON contains only expanded values.
- What happens with several YAML documents in one file?
- Documents separated by --- are parsed one by one. By default they are combined into a JSON array with one element per document; choose JSON Lines to get one compact line per document, handy for Kubernetes manifests and streaming tools.
- Why do yes, on and dates stay as strings?
- The converter follows the YAML 1.2 core schema: only true and false are booleans, while yes, no, on and off are plain strings, and dates stay strings because JSON has no date type. This matches modern tools such as Kubernetes and avoids the classic problem of NO turning into false.
- Is my data uploaded?
- No. Conversion runs entirely in your browser, so passwords, tokens and other secrets in your config files never leave your computer and are discarded when you close the page.