Convert YAML to JSON, or JSON to YAML — supports nested objects and arrays, both directions.
Yes, nested objects and arrays of any depth are supported in both conversion directions.
Standard key-value pairs, nested mappings, lists, strings, numbers, booleans, and null values are supported. Advanced YAML features like anchors, aliases, and multi-document files are not.
YAML is generally considered more human-readable for configuration files since it doesn't require quotes around keys or curly braces, though JSON remains the standard for data exchange between programs.
This tool converts YAML documents to JSON, or JSON to YAML, handling nested objects and arrays. It's useful for developers working with configuration files, Kubernetes manifests, CI/CD pipelines, and APIs that use either format.
Both YAML and JSON represent the same underlying data structures — objects (key-value mappings) and arrays (ordered lists) — but with different syntax. JSON uses curly braces, square brackets, and quoted keys, making it precise and easy for programs to parse. YAML uses indentation and minimal punctuation instead, which many developers find easier to read and write by hand, especially for configuration files, at the cost of being more sensitive to exact indentation.
Converting between YAML and JSON is useful when an API expects one format but your source data is in the other, when debugging by viewing YAML config in more explicit JSON form, or when migrating a project's configuration format. Since both represent identical underlying data, conversion between them is lossless for standard data types.
All conversion happens directly in your browser — your data is never sent to a server.
This converter reads YAML line by line, using each line's indentation level to figure out where it sits in the overall structure. When indentation increases, the parser treats that as a nested object or list; when it decreases, it closes out the current nesting level and returns to a shallower one. List items are recognized by a leading hyphen, and each key-value pair separated by a colon is interpreted either as a scalar value or the start of a new nested block depending on whether anything follows the colon on the same line.
true and false convert to JSON booleans.null, ~, or an empty value convert to JSON null.In the reverse direction, the tool walks the parsed JSON object recursively: nested objects become indented blocks, arrays become hyphen-prefixed lists (with nested objects inside an array getting their own indented block), and scalar values are written as plain text unless they look like they could be misread as a number, boolean, or null — in which case they're quoted to preserve their original type as a string.
Kubernetes manifests, GitHub Actions workflows, and Docker Compose files are all written in YAML, but debugging tools, APIs, and many programming language standard libraries work more naturally with JSON. Converting a manifest to JSON temporarily makes it easier to validate structure, diff against an API response, or feed into a JSON Schema validator, then convert back to YAML once you're done.
This converter supports the YAML features most configuration files actually use: nested mappings, lists, and the standard scalar types. It does not support YAML anchors and aliases (&/* references for reusing blocks), multi-document files separated by ---, or flow-style inline collections like {key: value} written on a single line. If your YAML file relies on these advanced features, a dedicated YAML library will handle them more reliably.
"30" in quotes is intentionally kept as a string, not converted to the number 30.JSON's structure is defined by its braces and brackets, so whitespace between tokens is purely cosmetic — you can minify a JSON file to a single line and it still parses correctly. YAML has no such delimiters; indentation is the only thing telling the parser where one block ends and another begins. This is why a YAML file that looks almost identical to a working one can fail to parse if a single line is indented with one space instead of two — it's also why converting to JSON is a useful sanity check, since the resulting braces make the actual nesting visible and unambiguous.
A common pattern among developers is pasting a YAML config that's behaving unexpectedly into this tool, converting it to JSON, and visually comparing the nesting against what was intended. Because JSON's braces make every level of nesting explicit, it's often faster to spot a misplaced key or an array that accidentally became an object than it is by staring at raw YAML indentation.