JSON to YAML Converter
Convert JSON back to clean, readable YAML config files.
Convert YAML to JSON online instantly. Paste any YAML file, including Kubernetes manifests and Docker Compose configs, and get clean JSON with nested structures and lists preserved. Everything runs 100% client-side in your browser, so your config data never leaves your device.
YAML is written by people. JSON is consumed by programs. Almost every reason to convert in this direction comes down to that split.
A continuous integration workflow, converted to JSON. Notice what does not survive.
YAML input
JSON output
Both comments are gone without a trace. The block scalar has been resolved into a single string with real newline escapes. The cron expression stayed a string because it was quoted in the source, which is exactly why it was quoted.
| YAML feature | Fate in JSON | Practical consequence |
|---|---|---|
| Comments | Dropped entirely | Round tripping YAML through JSON destroys documentation |
| Anchors and aliases | Expanded into duplicated data | File size grows, and the shared identity is lost |
| Merge keys | Resolved into literal keys | Overrides are baked in and no longer traceable |
| Multi-document files | Cannot be one JSON value | Emit a JSON array or separate files |
| Non-string keys | Illegal in JSON | Keys such as 1 or true are coerced to strings |
| Complex keys | No equivalent | A mapping used as a key has to be restructured |
| Block scalar style | Collapsed to one string | The pipe and fold distinction disappears once parsed |
| Explicit tags | Ignored | Custom types resolve to plain maps or strings |
| Trailing formatting and ordering | Not guaranteed | Key order preservation depends on the serialiser |
One anchor used three times
The JSON is correct and the values are right, but the intent is gone. Change the retry count later and you now have three places to edit instead of one. This is why the YAML file should stay the source of truth and the JSON should be treated as a build artefact.
A line consisting of three hyphens starts a new document, and Kubernetes manifests use this constantly to put several resources in one file. JSON has no document separator, so a three document YAML file becomes either a JSON array of three objects or three separate files. Choose deliberately, because a consumer expecting a single object will fail on an array.
YAML resolves untagged scalars using pattern rules. JSON has explicit syntax and no inference at all. The conversion therefore locks in whatever the YAML parser decided, and the decision is invisible in the output.
| YAML source | Parsed value | JSON output |
|---|---|---|
| version: 1.20 | Float | 1.2 |
| version: "1.20" | String | "1.20" |
| enabled: yes | Boolean under 1.1 | true |
| code: NO | Boolean false under 1.1 | false |
| zip: 01234 | Octal or string, parser dependent | 668 or "01234" |
| value: ~ | Null | null |
| blank: | Null | null |
| big: 12345678901234567890 | Integer beyond safe range | Precision loss in JavaScript |
The boolean rules changed between versions and most parsers did not follow. YAML 1.1 treats y, yes, on, true, n, no, off, and false as booleans in a range of casings. YAML 1.2 narrowed this dramatically, with the core schema recognising only true and false.
The catch is that many popular libraries still implement 1.1 semantics by default even though 1.2 was published in 2009. So the same file can convert differently depending on which language and which library you run it through, which is a genuinely unpleasant class of bug when a deployment pipeline and a local script disagree.
The defence is simple and costs nothing: quote any scalar whose string identity matters. Country codes, version numbers, times, zero padded ids, and single letter flags should all be quoted in the source. Then no parser has a decision to make.
Strict JSON is usually a stepping stone. Head to the full converter collection for JSON to YAML to return to a human friendly config, JSON Schema to validate the structure you just produced, and JSON to TypeScript to type it in application code.
YAML dominates DevOps configuration: Kubernetes manifests, Docker Compose files, CI pipelines, and Helm values are all written in it. But when that data needs to reach an API, a JavaScript application, or a JSON Schema validator, you need JSON. This YAML to JSON converter handles the translation instantly: nested mappings become objects, sequences become arrays, anchors and aliases are expanded, and multi-line strings are flattened into standard JSON strings. It is also a quick sanity check for YAML's notorious type quirks, since the JSON output shows exactly whether a value parsed as a string, number, or boolean. Free, instant, and entirely in your browser.