JSON to YAML Converter

Convert JSON to YAML online for configs and CI pipelines — free and instant converter.

About

About the JSON to YAML Converter

Paste JSON and get readable YAML back instantly — useful when a config format expects YAML (like a Kubernetes manifest or a CI pipeline file) but you have the data as JSON. It dumps using js-yaml's default block style, which favours clean indentation over inline {}/[] for anything but the simplest values.

The YAML is written in block style with a 2-space indent and keys in their original order. Strings that would otherwise be read as another type — like "true", "123" or "null" — are wrapped in quotes so they stay strings, and empty objects and arrays are written as {} and [].

Choose what to view about this tool

Guide

Using the JSON to YAML Converter

  1. 1

    Step 1

    JSON to YAML is already the button to use — YAML to JSON works the other way.

  2. 2

    Step 2

    Paste your JSON into the input box.

  3. 3

    Step 3

    Click "JSON → YAML" to see the converted YAML in the output box.

  4. 4

    Step 4

    Copy the YAML to use in your config file.

  • Writes block-style YAML with a 2-space indent
  • Quotes strings like "true" or "123" so their type doesn't change
  • Keeps keys in the same order as your JSON
  • Copy the result in one click
  • Loads the conversion library from this site the first time you use it
  • Runs in your browser — free, with no sign-up and nothing uploaded

DevOps engineers

Engineers turn kubectl -o json output into a readable manifest.

Docker and CI users

Users write Docker Compose or GitHub Actions files starting from JSON examples.

Backend developers

Developers move JSON settings into a YAML config like Spring Boot's application.yml.

API developers

Developers rewrite a JSON OpenAPI spec as YAML that's easier to edit by hand.

Convert the other direction

Examples

JSON to YAML Converter examples

4 worked examples

01

Flat object

Convert {"apiVersion":"v1","kind":"Pod"} to get "apiVersion: v1" followed by "kind: Pod", ready to paste straight into a manifest.

02

Nested object

Convert {"user":{"name":"Ann","role":"admin"}} to get "user:" followed by "name: Ann" and "role: admin" indented underneath it in block style.

03

Array of scalars

Convert {"colors":["red","green","blue"]} to get "colors:" followed by "- red", "- green" and "- blue", each item on its own list line.

04

Strings that look like other types

{"answer":"yes","zip":"007"} converts to answer: 'yes' and zip: '007' — quoted so they stay strings.

FAQ

Frequently asked questions

Quick answers to common questions about the JSON to YAML Converter.

How do I convert JSON to YAML?

Paste your JSON above and click "JSON → YAML". The converted YAML appears in the output box — everything runs in your browser, using the js-yaml library.

Does the output use block style or inline {}/[] style?

It dumps using js-yaml's default block style, which prefers block indentation (one key per line) over inline {}/[] notation for anything beyond the simplest scalar values — the more human-readable form YAML is usually written in.

Will nested objects and arrays convert correctly?

Yes — nested JSON objects become indented YAML mappings and JSON arrays become YAML lists with - markers, preserving the same structure.

Is this JSON to YAML converter free?

Yes. It's free, with no sign-up and no limit on how much you convert.

Can I convert YAML back to JSON?

Yes — the same tool handles both directions. Click "YAML → JSON" instead, or use the dedicated YAML to JSON converter page.

Is my JSON sent anywhere when I convert it?

No. The conversion runs directly in your browser — nothing is uploaded to a server.

Why are some values wrapped in quotes in the YAML?

Strings that YAML would otherwise read as another type are quoted to keep them as text — so "yes", "007" and "true" written as strings in your JSON come out as 'yes', '007' and 'true'.

Is the order of keys kept?

Yes. Keys are written in exactly the order they appear in your JSON; nothing is sorted.

Can I paste JSON with comments or trailing commas?

No. The input must be strict JSON, so comments and trailing commas cause an error. Remove them first — the JSON Validator points to the exact line and column of each problem.

Still have a question? Contact us

Report a problem

JSON to YAML Converter

What went wrong?
    or paste a screenshot