JSON to YAML
Convert JSON to YAML with a 120-character line width and no anchors.
Processing: runs in your browser, nothing uploaded
About JSON to YAML
Config files in Kubernetes, GitHub Actions, and plenty of app repos want YAML, while the sample payload you have is JSON. JSON to YAML parses the JSON and prints YAML.
How the YAML is shaped
The dumper uses a 120-character line width and does not emit anchors or aliases. Nested objects and arrays come across. Key order follows the JSON you pasted. A long string may stay on one line until it hits that width. There is no indent-size control on the page. YAML to JSON is the reverse. JSON Formatter and JSON Viewer help when the JSON itself is hard to read. JSON Validator is the syntax check when the paste fails before any YAML appears.
What cannot come along
JSON has no comments, so the YAML will not gain any. If you had comments in a YAML file, converted to JSON, and came back, those comments are already gone. Undefined and functions are not JSON. Trailing commas fail the parse, same as in a validator. Dates that were strings stay strings. Numbers stay numbers. A field you need as a string, such as a postal code with a leading zero, must already be a JSON string or the zero is gone before YAML ever sees it.
Read it once before you commit
Look at multiline strings and at keys that contain odd characters. The result is text you copy into a repo. This page does not talk to a cluster and does not check that the YAML matches a schema. If the next step is a human review, pretty JSON first, convert second, and diff the YAML in git rather than converting it twice and hoping the bytes match.
How to use
- 1
Paste JSON with no trailing commas and no comments.
- 2
Run the conversion. The YAML uses a 120-character line width and no anchors.
- 3
Copy it into the repo and read multiline fields once. Use YAML to JSON for the reverse.
Privacy
The conversion runs in the browser. The JSON is not uploaded.
Frequently asked questions
Will comments in my JSON be kept?
JSON cannot contain comments. If the parse fails, the comments are why. They will not appear in the YAML.
Are YAML anchors created?
No. The dumper writes plain YAML with a 120-character line width and no anchors.
How do I go back to JSON?
Use YAML to JSON. Comments you add by hand in the YAML will not survive that return trip.
Does this check a Kubernetes schema?
No. It only converts the data. Invalid structure for a specific tool can still be valid YAML.
Nested objects?
Full JSON structures are converted to YAML.
Runs locally?
Yes, conversion happens in your browser.
Related tools
Browse all Text Tools · Sitemap