JSON to YAML
Convert configuration to YAML with the strings that would change meaning quoted — including the country code that loads as false.
Runs entirely in your browser
Loading tool...
How to use
- Paste the JSON — a config file, an API response, a manifest.
- Pick the indent your project uses; two spaces is the convention.
- Add the document marker if the file will hold more than one document.
- Copy or download the YAML.
Features
- Quotes any string YAML would otherwise read as a number, date, boolean or null.
- Multi-line strings written as literal blocks, keeping their line breaks.
- List items with the dash on the same line as the first key, the way YAML is written by hand.
- Empty objects and arrays written inline rather than as nothing.
- Runs entirely in your browser.
Frequently asked questions
- What is the Norway problem?
- YAML 1.1 reads `no` as the boolean false, so a list of country codes containing Norway silently becomes a list with `false` in it. The same applies to `yes`, `on`, `off`, `y` and `n`. Every such string is quoted here, which is the only reliable fix.
- Why is my version number quoted?
- Because `1.20` unquoted is the number 1.2, and the trailing zero disappears. The same happens to a postcode like `01234`, which loses its leading zero. Quoting keeps them the strings they were in your JSON.
- Why is there no YAML to JSON?
- Because writing YAML is well defined and reading it is not. The specification allows several ways to write the same value, plus anchors, aliases, tags and multiple documents — a partial parser silently misreads real config files, which is worse than not offering the direction at all.
Related tools
Reads the YAML that appears in real config files, and says when it meets syntax it will not guess at rather than quietly mis-reading it.
Reads a .env file the way loaders actually read it, and flags the lines where what you wrote is not what your app will get.
Format and beautify JSON instantly.
What actually changed between two JSON documents — by value and path, not by line.