JSON to YAML
Turn JSON into clean YAML for a config file, with the indentation and key order you choose.
or drop them here · files stay on your device
We count formats and sizes. Filenames stay private unless you opt in.
- Runs on your device
- No sign-up or watermark
- No fixed file size cap
The short answer
To convert JSON to YAML, choose one or more .json files, set the indent between 2 and 8 spaces and decide whether to sort keys. js-yaml writes the YAML in your browser, so nothing is uploaded. Strings that YAML could misread, such as "yes" or "007", are quoted automatically.
How to convert JSON to YAML for a config file
- STEP 1
Choose JSON files
Select one or more .json files. They are parsed on your device, never on a server.
- STEP 2
Set the indent
Use the Indent slider to pick 2 to 8 spaces. Two is the usual choice for Kubernetes and Compose files.
- STEP 3
Sort keys if useful
Turn on Sort keys alphabetically for stable output that diffs cleanly between versions.
- STEP 4
Copy or download
Copy the YAML from the preview, or download it as a .yaml file; several files arrive as a ZIP.
When you want YAML instead of JSON
Many tools accept both formats but are documented in YAML: Kubernetes, Docker Compose, Ansible, GitHub Actions and OpenAPI. YAML drops the braces and most quotes, so a manifest someone will edit by hand is easier to read and to review in a diff.
The risk in YAML is implicit typing. An unquoted 007 reads as a number and, in older YAML 1.1 parsers, an unquoted no reads as false. A careful converter quotes any string that could be read as something else, which this one does.
What survives, and what does not
The JSON is parsed, then written with js-yaml’s dump using your indent, optional key sorting, a 100-character line width for long strings, and no anchors or aliases. Key order follows the JSON unless sorting is on. Each input file produces its own .yaml file.
What you keep
All values and their types: strings stay strings, numbers stay numbers
Key order from the JSON, unless you sort
Ambiguous strings such as "yes", "true" and "007", quoted so they do not change type
What you lose
Repeated objects are written out in full rather than as YAML anchors
Precision on integers above 2^53, rounded by the JSON parser
No comments are added; YAML can hold them but JSON never had any
Honest limits are published on every tool page. If a tool cannot do something well, it says so here rather than letting you find out after the download.
JSON to YAML at a glance
| Input | JSON |
|---|---|
| Output | YAML |
| Indent | 2 to 8 spaces |
| Library | js-yaml |
| Batch | Yes, several files at once |
| Runs on | Your device, in the browser |
If something goes wrong
It says the file is not valid JSON
The JSON must parse strictly: no comments, no trailing commas, double quotes only. Run it through Format JSON first to find the error.
Some values are wrapped in quotes
That is deliberate. Strings that YAML would otherwise read as a number, boolean, date or null are quoted to keep them strings.
JSON to YAML questions
How do I convert JSON to YAML for Kubernetes?
Choose the JSON manifest, keep the indent at 2 spaces and convert. Check that fields like replicas are numbers in the JSON, since a quoted "3" stays a string.
Will my key order be preserved?
Yes, keys come out in the order they appear in the JSON. Turn on Sort keys alphabetically if you want them reordered.
Why are some strings quoted in the YAML?
Values like "yes", "on", "true" or "007" would be read as booleans or numbers if left bare, so they are quoted to stay strings.
Does it create YAML anchors for repeated data?
No. Every value is written in full, which is longer but simpler for every YAML reader to handle.
Is the JSON uploaded?
No. Conversion runs in your browser tab, so a kubeconfig or a payload with secrets in it never leaves your device.