Code & Data

Convert JSON to YAML

Paste JSON and get YAML — block style, two-space indents, and quoting applied only where a bare word would change type on the way back.

or paste your own — nothing is uploaded.
YAML

Paste valid JSON above and the result appears here.

  • Runs in your browser
  • No account required
  • Free to use

How it works

01

The quoting is the whole difficulty

YAML reads bare words as types. A string "yes" comes back as a boolean, "1.5" as a number, and "null" as nothing at all. So any string that looks like another type is quoted, and anything else is left bare — which is what makes the output both readable and lossless.

02

Block style throughout

Nested maps and sequences rather than inline braces. It is the form people write YAML in, and the form that stays readable as a config file grows.

03

Writing YAML is much easier than reading it

A YAML parser has to accept a dozen ways of expressing the same thing. A writer picks one and uses it consistently, which is why this direction can be done properly in a small amount of code and the reverse cannot.

What it does

Type-safe quoting

Strings that would read back as booleans, numbers or null are quoted. Ordinary words are not, so the result does not look like it was generated by a machine.

Empty containers stay explicit

An empty object becomes `{}` and an empty array `[]`, rather than vanishing into a key with nothing after it.

Key sorting

Optional, applied recursively — useful when the YAML is going into version control and you want a stable diff.

Your data never leaves the page

API responses, config files and exports are exactly the sort of thing that should not be pasted into someone else’s server. Parsing happens in your browser and what you paste is never transmitted — there is no code here that could send it anywhere, even by accident.

Practical advice

Getting a better result

  • YAML is whitespace-significant. If you edit the result, keep the two-space indentation consistent or it will not parse.
  • The Norway problem is real: unquoted `no` is a boolean in YAML 1.1, which is why country codes and similar values are quoted here.
  • For Kubernetes and CI config, block style is what every example uses and what reviewers expect.

Questions

Things people ask

Why are some of my strings quoted and others not?

Because a bare word in YAML is typed by what it looks like. "yes", "true", "null" and "1.5" would all be read back as something other than a string, so they are quoted. Ordinary words cannot be mistaken for anything else and are left bare.

Does it convert YAML back to JSON?

Not yet. Parsing YAML properly is a substantially harder problem than writing it — the specification allows many forms for the same data — and a half-implemented parser that quietly mis-reads a config file is worse than none.

Who builds these

Free tools by day. Websites that earn their keep by trade.

KuConvert is built by KUDUY, a web design and development agency. From custom WordPress builds to SEO and e-commerce, everything they do is engineered to bring you more qualified traffic and turn it into revenue.

  • Fixed scope, no surprise invoices

    Most sites ship in four to eight weeks with the scope and the price agreed up front.

  • SEO from day one

    Search is designed into the build — structure, schema and Core Web Vitals — not retrofitted.

  • A team, not a ticket queue

    A project manager, a designer and a developer you can actually reach.

Need your whole site to load this fast?

Images are usually the heaviest thing on a page and the easiest win. KUDUY works on site speed, image delivery and Core Web Vitals for teams who would rather not do it by hand.

This tool runs entirely in your browser. Your files are never uploaded.