YAML Formatter
Normalise YAML indentation, quoting and key order in one pass.
Convert JSON to clean, correctly quoted YAML in one step.
The JSON to YAML converter rewrites a document in readable block style — keys on their own lines, lists as dashes, no braces — and quotes exactly those strings that would otherwise read back as a different type.
YAML is a superset of JSON, so every JSON document is already valid YAML — but nobody wants to read it that way. This converter rewrites it in the block style people actually use: keys on their own lines, lists as dashes, no braces or brackets.
The quoting rules are handled for you, which is where a naive conversion goes wrong. A string value of "yes", "off" or "null" would read back as a boolean or a null. A value of "007" would lose its leading zeros. A value containing a colon and a space would read as a nested mapping. Each of those is quoted on the way out, so the YAML round-trips back to exactly the JSON you started with.
Values such as "yes", "off" and "007" are quoted, so converting back gives you exactly the JSON you started with.
Output uses the dashes and indentation people actually write, rather than the JSON-shaped flow style that is technically valid YAML.
A value containing line breaks becomes a literal block scalar, which keeps the breaks without escape sequences.
Two spaces by default, which is the near-universal convention, with four available.
Paste the result into YAML to JSON to confirm nothing changed type on the way through.
An object, an array or any valid JSON document.
Two spaces is the convention; four is available if your project uses it.
Automatic quotes only what needs it. Always-quote is the safest option for values headed into a shell.
Ready to paste into a config file or download as .yaml.
Yes — YAML 1.2 is a strict superset of JSON, so you could paste JSON straight into a YAML file. The point of converting is readability, not compatibility.
Because only some need it. Anything that would read back as a boolean, a number, a null or a nested key is quoted; ordinary words are left bare, which is what makes YAML readable.
As a literal block scalar with the |- marker, which preserves the line breaks without needing escape sequences.
Yes, with the YAML to JSON tool. The pair round-trips, which is the quickest way to confirm nothing changed type on the way through.
What people who use the JSON to YAML think of it. Reviews come from visitors and are posted as written.
No ratings yet
Yours would be the first.
0 reviews
Newest first
No reviews yet
Be the first to rate the JSON to YAML. It takes half a minute and no account.
Write the first reviewNormalise YAML indentation, quoting and key order in one pass.
Convert JSON into XML, with control over attributes, arrays and the root element.
Encrypt text with a password using AES-GCM, and decrypt it back.
Generate deterministic UUIDs from a namespace and a name.
Convert tab-separated data — or a spreadsheet paste — straight into JSON.
Build a .gitignore from templates for your stack, editor and OS.
Re-indent JavaScript, with strings and regular expressions left alone.
Generate prefixed API keys in the format modern providers use.