Skip to content

JSON to YAML

Convert JSON to clean, correctly quoted YAML in one step.

Quick Tool Overview

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.

What it does
Converts JSON into readable block-style YAML
You give it
Any valid JSON document
You get back
YAML with correct quoting and indentation
Best for
Turning API config into Compose, CI or Helm files
Developer Tools Free, unlimited use No sign-up Runs in your browser

About the JSON to YAML

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.

Key features of the JSON to YAML

Quoting that round-trips

Values such as "yes", "off" and "007" are quoted, so converting back gives you exactly the JSON you started with.

Block style, not flow

Output uses the dashes and indentation people actually write, rather than the JSON-shaped flow style that is technically valid YAML.

Multi-line strings

A value containing line breaks becomes a literal block scalar, which keeps the breaks without escape sequences.

Configurable indentation

Two spaces by default, which is the near-universal convention, with four available.

Verified by round trip

Paste the result into YAML to JSON to confirm nothing changed type on the way through.

How to use the JSON to YAML

  1. 1

    Paste your JSON

    An object, an array or any valid JSON document.

  2. 2

    Set the indentation

    Two spaces is the convention; four is available if your project uses it.

  3. 3

    Check the quoting

    Automatic quotes only what needs it. Always-quote is the safest option for values headed into a shell.

  4. 4

    Copy the YAML

    Ready to paste into a config file or download as .yaml.

Frequently asked questions

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.

Reviews of the JSON to YAML

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.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

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 review

More developer tools