YAML to JSON
Convert YAML to JSON live — supports multi-document YAML (--- → array), optional deep key sorting, and configurable indentation.
About this ToolHow it works, benefits & use casesTap to collapse
Paste YAML and get clean JSON back instantly. Built on the js-yaml parser, this converter understands the full YAML 1.1 syntax — nested mappings, block and flow sequences, quoted and unquoted scalars, anchors and the usual type tags. It is multi-document aware: when your input contains several documents separated by --- markers, they are collected into a JSON array so nothing is lost. You can choose 2- or 4-space indentation for the JSON output, and optionally sort keys deeply so that every nested object comes out in alphabetical order for stable diffs. Invalid YAML produces a clear error message rather than a crash, and the tool notes when multiple documents were merged into an array. The JSON streams live as you edit and can be copied, downloaded as a .json file, or shared via URL. Everything is parsed locally in your browser — your YAML is never uploaded.
How to Use
- 1Pick the JSON indentation you want, either 2 or 4 spaces.
- 2Toggle "Sort keys" if you want every nested object emitted in deep alphabetical order.
- 3Paste your YAML into the input panel — the JSON updates live — or click "Load example".
- 4Press "Convert to JSON" to validate the YAML; any syntax error is shown with a description.
- 5Copy the JSON, download it as output.json, or share it with the generated URL.
Key Benefits
- Full YAML parsing via js-yaml — mappings, sequences, scalars and tags
- Multi-document aware: --- separated documents become a JSON array
- Optional deep alphabetical key sorting for stable, diff-friendly output
- Selectable 2- or 4-space JSON indentation
- Clear error messages on invalid YAML instead of failures
- Live conversion with copy, .json download and shareable URLs
- Parsed entirely in the browser — nothing is uploaded
Common Use Cases
- Converting a Kubernetes or CI YAML manifest into JSON for tooling
- Importing a YAML config into code that expects JSON
- Merging a multi-document YAML file into a single JSON array
- Normalising key order before committing or diffing converted output
- Quickly inspecting deeply nested YAML by reading it as JSON
Options
Deep alphabetical key order
0 characters · live · multi-document aware
Paste YAML above to see the JSON live.
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- OpenAPI Spec ViewerView and explore OpenAPI/Swagger specifications
- GitHub Actions GeneratorVisual workflow builder — triggers, jobs, a build matrix, job dependencies, and steps from a real action catalogue, with live YAML and a linter
- Color ConverterConvert between HEX, RGB, HSL, and HSV
- cURL to Code ConverterConvert cURL commands to code in various languages
- JSON Path FinderFind and test JSON paths
- npm to Yarn ConverterConvert npm commands and package-lock.json to Yarn equivalents
If your input contains more than one document separated by --- markers, each document is parsed and the results are combined into a JSON array, in order. The tool shows a note such as "3 YAML documents to JSON array" so you know a merge happened. A single document is converted to a plain JSON value.
Yes. Sorting is applied deeply, so keys are alphabetised at every level of nesting, not just the top. This is useful for producing stable output that diffs cleanly across runs.

