About JSON to YAML
JSON is what APIs return; YAML is what people usually have to edit by hand, from Kubernetes manifests to GitHub Actions workflows. Rebuilding a JSON payload as YAML manually invites its own class of mistakes, especially around nested arrays and strings that need quoting. This converter validates the JSON first, then serializes the parsed value as YAML in one step.
Indentation can be two or four spaces, and object keys can be sorted alphabetically at every level to make two exports easier to compare. The YAML is generated with the standard `yaml` library, so strings that could be ambiguous, such as yes, null or values containing a colon, are quoted correctly. Everything runs locally: the JSON is parsed in the browser, nothing is uploaded and invalid input is reported with a line and column before any YAML is produced.
What this tool does
Valid JSON required first
The converter runs JSON.parse before generating YAML, so trailing commas, comments and single quotes are caught instead of being silently carried into a broken file.
Two- or four-space indent
Pick the nesting width your project already uses; the output follows that setting consistently for every nested block and list.
Optional key sorting
Sort object keys alphabetically at every level to stabilize the output when comparing two exports or reviewing a diff.
Sensible quoting
Strings that YAML would otherwise misread, such as yes, null, numbers written as strings or values containing colons, are quoted automatically.
Copy and download
Copy the YAML with one button or download it as a .yaml file, ready to commit or paste into a manifest.
Sample and clear
Load an example payload to try the options, then clear the panes and convert your own JSON.
How to use JSON to YAML
- 01
Paste JSON
Paste the payload into the input pane. The JSON must be complete and use double-quoted strings; the converter reports the first syntax error otherwise.
- 02
Choose indentation
Select two or four spaces from the indent menu, and tick Sort keys if you want object keys in alphabetical order.
- 03
Convert to YAML
Press Convert to YAML. The payload is parsed and serialized in the browser after the interface has painted.
- 04
Review the YAML
Check that nested arrays and objects came through as expected and that strings which look like booleans or numbers are quoted.
- 05
Copy or download
Copy the YAML or download it as a .yaml file; the file name is based on the loaded JSON if one was uploaded, otherwise on a default name.
Supported formats and limits
- Input
- JSON
- Output
- YAML
- Processing
- Client-side, in your browser. Nothing is uploaded.
- Maximum size
- Bound by the memory available to your browser tab.
- Requirements
- Chrome, Edge, Firefox or Safari · JavaScript enabled
Limitations worth knowing
- Input must be strict JSON; comments, trailing commas and single-quoted strings are rejected.
- The YAML output is always block style with the indentation you choose; flow style and custom tags are not exposed.
- Input is limited to 8 MB of text, and very large payloads are serialized on the main thread after a short yield.
- Non-string JSON keys cannot exist by definition, so no key conversion is needed or performed.
Privacy and file handling
Everything happens in your browser. The JSON is parsed and serialized to YAML in memory with JavaScript, so nothing is uploaded, stored or logged. Closing the page discards the input, the uploaded file and the YAML result.
Read the full privacy policy