Skip to main content
7BBusyBoss

JSON to YAML Converter — Clean Output

Convert JSON into YAML with strings quoted wherever a bare value would change type — so codes like 0700 and country codes survive the trip.

No limitsZero data leaksSuper fast
YAML appears here...

One-way: JSON → YAML. (YAML → JSON requires a fuller parser; coming soon.)

You're on 7BusyBoss — 300+ free tools that run instantly in your browser. No signup, nothing uploaded.

Browse all Code Formatters
About this tool

Two formats for two audiences

JSON is unambiguous and verbose: every type is explicit and there is nothing to interpret. It is what programs exchange. YAML was designed to be written and read by people — configuration, CI pipelines, container manifests — and it buys that readability with implicit behaviour.

One genuinely useful fact: JSON is a valid subset of YAML, so any YAML parser will read JSON as-is. You can migrate a file gradually, or drop a JSON block inside YAML where precision matters more than looks.

Note the direction here — this converts JSON into YAML. The reverse needs a full YAML parser, which is a much larger problem than serialising.

Implicit typing, which is where YAML bites

YAML infers a value's type from how it looks. A bare word is a string unless it matches a pattern, and the patterns catch more than people expect.

The country-code case

A list of two-letter country codes written bare:

countries:
- NO
- SE

Under YAML 1.1 rules, which most parsers in the wild still follow, NO is read as the boolean false. The list silently loses Norway. Quote it — "NO" — and it stays a string.

Leading zeros become octal

An account reference or ID written 0700 is read as octal, giving the number 448. 01234 becomes 668. Not a formatting change — a different number.

Ambiguous booleans

yes, no, on, off, and even bare y and n are booleans to some parsers and strings to others. response: yes may mean true, or may mean the word. Which one you get depends on a library version you probably did not choose.

Version numbers get truncated

A version written 1.10 read as a number becomes 1.1, which is a different version. Similarly, a bare ISO date is read as a timestamp rather than text.

The habit that prevents nearly all of this is one line long: if a value is meant to be a string, quote it.

What the converter does about it

This is where the conversion earns its keep. When it writes a string that would change type as a bare value, it quotes it automatically — anything numeric-looking, any of the boolean or null keywords including on, off, y and n, and anything shaped like a date. So a JSON string "0700" comes out as "0700" rather than as a number waiting to happen.

What it cannot do is guess intent. If your JSON holds a real number, it stays an unquoted number, which is correct — the tool preserves what JSON told it, and JSON was explicit.

Indentation

YAML uses whitespace for structure, so a misplaced space changes the meaning rather than raising an error, and tabs are not permitted as indentation at all.

This is why YAML errors so often point several lines past the actual mistake: the parser accepted a different structure than you intended and only hit something impossible later. If an error makes no sense at the line it names, look above it.

The other direction, and comments

Worth knowing before you plan a round trip: YAML to JSON discards every comment, because JSON has no comment syntax. In a configuration file the comments are frequently the most valuable thing in it — why a setting exists, what breaks if you change it — and no conversion can carry them across.

So treat JSON as the wire format and YAML as the file humans maintain, rather than converting back and forth as though they were interchangeable.

Everything runs in your browser and nothing is uploaded. To check the JSON is well-formed first, use the JSON formatter.

How to use the JSON to YAML Converter

Takes about a minute. No signup, no download, your data stays in your browser.

  1. 1
    Open the tool. Scroll up to the JSON to YAML Converter above — it loads instantly in your browser, no install needed.
  2. 2
    Enter your values. The fields come pre-filled with realistic defaults so you can see how it works — replace them with your own numbers.
  3. 3
    Read the result. The output updates instantly. Copy or share it — nothing is uploaded to a server, everything stays on your device.

Frequently asked questions

Common questions about the JSON to YAML Converter.

Why does YAML turn my string into a number or a boolean?

Because bare values are typed by appearance. Under the widely-followed YAML 1.1 rules, no becomes false, 0700 is read as octal and becomes 448, and 1.10 becomes 1.1. Quoting the value forces it to stay text, which is the single habit that prevents nearly every YAML type surprise.

Does the converter quote strings for me?

Yes, where a bare value would change type. Anything numeric-looking, the boolean and null keywords including on, off, y and n, and anything shaped like a date are all quoted automatically. So the JSON string 0700 comes out quoted rather than as a number waiting to be misread.

Does it convert YAML back to JSON?

No, this direction is JSON into YAML. Reading YAML properly needs a full parser rather than a serialiser, which is a considerably larger job. Be aware that the reverse conversion also discards every comment, since JSON has no comment syntax.

Why do YAML error messages point at the wrong line?

Because indentation carries meaning, so a misplaced space does not break the syntax — it describes a different structure, which the parser accepts and only chokes on later. When an error makes no sense at the line it names, the mistake is usually above it. Tabs are not allowed as indentation at all.

Why do people use YAML if it has these traps?

Because it is far pleasanter to write and read than JSON for anything a person maintains by hand — no braces, no quotes everywhere, and comments are allowed. The traps are real but they all have the same fix, and the readability is worth it for configuration files.

Is my data uploaded?

No, the conversion runs in your browser and nothing is sent anywhere. That matters for this tool in particular, since the JSON people convert to YAML is often configuration containing hostnames, service names or credentials placeholders.

Community rating

Discussion (0)

No comments yet. Start the discussion.