YAML is common in config files such as Docker Compose, Kubernetes manifests and CI pipelines, while most APIs and tools expect JSON. This tool converts between the two in both directions, so you can check what a YAML file really contains or write a config from a JSON payload.
It reads multi-document YAML, expands anchors, aliases and merge keys, and lets you pick 2 spaces, 4 spaces or tab indentation and sort the keys. If the input is not valid, you see the line and column of the first problem with a plain message. Everything runs in your browser using the open source js-yaml library.
Paste or upload your YAML with YAML to JSON selected. The JSON appears as you type. Choose the indentation, then copy it or download it as a .json file.
Choose JSON to YAML and paste your JSON. You can also press Swap on a finished conversion to turn the result back into the other format.
Documents separated by --- are read one by one. When there is more than one, the JSON result is an array with one item per document. Going the other way, turn on Split array into documents to write each item of a top-level array as its own document.
Yes. An alias such as *base is replaced by a copy of the value it points to, and a merge key (<<: *base) is expanded, so the JSON contains the full data.
The tool shows the line and column of the first problem with a plain message, and a Go to error button that selects it in the input.
No. The conversion runs in your browser and nothing leaves your device.
Comments are dropped because JSON has no comments, and anchors turn into plain copies. Dates such as 2026-11-08 become ISO strings. Integers larger than 9007199254740991 can lose precision, as they do in any JavaScript tool.