filetity
Your JSON
YAML
LocalThis runs in your browser. Nothing you paste is sent anywhere, which matters when the YAML is a manifest with secrets in it.

JSON -> YAML · Local tool

JSON to YAML

Convert JSON to readable YAML, with no folded lines.

Last updated

How do I convert JSON to YAML?

Paste the JSON into filetity's converter and readable YAML appears beside it, in the browser tab with nothing uploaded. Two of the underlying library's defaults are deliberately changed here. Long values are never folded, because the default wraps anything past 80 characters and splits a URL or a token across two lines with an indent in the middle, which is valid YAML and unusable if you need to copy the value. And a value that appears twice is written out twice rather than as an anchor and an alias: that is correct YAML and completely baffling to somebody who pasted plain JSON and got back a document full of ampersands and asterisks. Keys can be sorted, which is worth doing when you are about to compare two files.

  1. 01 / Your device

    the file stays here

  2. 02 / Browser memory

    the work runs locally

  3. 03 / Back to you

    saved on this device

When you would use this

Situations, not settings.

Turning an API response into a config file
YAML is what most config formats want and is far easier to read and comment on than JSON once it is more than a screen long.
Writing a manifest by hand from a sample payload
Long values are never folded across lines, so a URL or a token survives being copied out of the result.
Comparing two configs that disagree
Sort the keys on both and the diff is about the values rather than about the order somebody happened to type them in.

How it works / no cloud

A conversion engine, not an upload form.

Written with js-yaml, with two of its defaults deliberately changed. Long values are never wrapped, because the default folds at 80 characters and breaks a URL across lines. And a value appearing twice is written out twice rather than as an anchor and an alias, which is valid YAML and baffling to somebody who pasted plain JSON.

  • Offline ready
  • Installable app
  • No file limit queue

Straight answers

No accordion. Nothing hidden.

Is it free?
Yes, with no watermark and no page limit.
Does it need an account?
No. There is no account system.
Is my file processed on my device?
Yes. The file is read by your browser and never uploaded. There is no server to send it to.
What formats are supported?
JSON in, any valid document. YAML out, two space indented, with keys optionally sorted.
What are the 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.
Does it work on mobile?
Yes, on any modern mobile browser. Large files are limited by the memory the phone gives the browser.
Does it work offline?
Yes, once the page has loaded. The tool keeps working with no network connection.
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.

Keep working locally

3 available · more coming