# JSON to YAML

Convert JSON to readable YAML, with long values never folded across lines. Free, no signup, and nothing you paste is uploaded.

Canonical page: https://filetity.com/json-to-yaml

## Capabilities

- Free: Yes, with no watermark and no page limit.
- Account required: No. There is no account system.
- Processed on device: Yes. The file is read by your browser and never uploaded. There is no server to send it to.
- Formats: JSON in, any valid document. YAML out, two space indented, with keys optionally sorted.
- Limits: No size limit beyond what your browser holds. YAML cannot represent a circular structure, and JSON cannot contain one, so that case does not arise.
- Mobile: Yes, on any modern mobile browser. Large files are limited by the memory the phone gives the browser.
- Offline: Yes, once the page has loaded. The tool keeps working with no network connection.

## Questions

### Why are my long URLs not wrapped?

Deliberately. The library's default folds any line past 80 characters, which splits a URL or a long token across two lines with an indent in the middle. It is still valid YAML and it still parses, and it is also unusable if anyone needs to copy that value out, so wrapping is off.

### What is an anchor and why does the output not have any?

When the same object appears twice, YAML can define it once with an anchor and refer back to it with an alias. That is correct and compact and completely confusing to somebody who pasted plain JSON and got back a document full of ampersands and asterisks, so repeated values are written out in full.

### Should I sort the keys?

Only if you are diffing two files. Sorting makes two documents comparable regardless of the order their keys happened to be in, which is useful. It is off by default because key order is often meaningful to a person reading a config, even though YAML itself does not care.

### Do quotes disappear from my strings?

Where they are not needed, yes, and that is what makes YAML readable. A value is quoted when leaving it bare would change its meaning, such as a string that looks like a number or a boolean. So the string "true" keeps its quotes and the word true does not.

### Can I paste an array at the top level?

Yes. A top level array becomes a YAML sequence of dashes, which is a valid document. JSON allows any value at the top level and so does YAML, so a bare string or a number converts too, though the result is rarely useful on its own.

## Related tools

- [YAML to JSON](https://filetity.com/yaml-to-json): Convert YAML to JSON, including multi document streams.
- [JSON Formatter and Validator](https://filetity.com/json-formatter): Format, beautify, validate and read JSON, and find the line that broke it.
