JSON to YAML

Convert JSON to YAML online for free. Paste JSON and get readable YAML instantly, in your browser.

Suggested tools

YAML to JSON

Convert YAML into JSON.

YAMLJSON
Open Tool

YAML Formatter

Re-indent YAML and check it for syntax errors, with line numbers.

YAML
Open Tool

XML to YAML

Convert XML into YAML.

XMLYAML
Open Tool

YAML to XML

Convert YAML into XML.

YAMLXML
Open Tool

YAML to CSV

Convert a YAML list into CSV.

YAMLCSV
Open Tool

CSV to YAML

Convert CSV into YAML.

CSVYAML
Open Tool

About JSON to YAML

JSON to YAML converts JSON into clean, readable YAML for Docker Compose, Kubernetes, GitHub Actions, Ansible and other configuration files. Objects, arrays, numbers, booleans and null values carry over exactly.

The YAML uses two-space indentation and never wraps long lines, and strings that could be misread (such as "yes" or "0123") are quoted automatically. It runs entirely in your browser, so nothing you paste is uploaded.

How to use JSON to YAML

  1. Paste JSON, upload a .json file or click Sample.
  2. Press Convert.
  3. Copy or download the YAML.

Key features

  • Exact data types preserved
  • Two-space indentation, no line wrapping
  • Ambiguous strings quoted automatically
  • Validates the JSON first with clear errors

Example

A small Docker-style service definition converted to YAML.

Input
{"service":"web","image":"nginx:1.27","ports":["80:80"],"restart":true}
Output
service: web
image: nginx:1.27
ports:
  - '80:80'
restart: true

When to use JSON to YAML

  • Turning JSON examples from documentation into YAML for Kubernetes or Docker Compose.
  • Making a large JSON config easier to read and comment.
  • Converting API specifications to YAML.

Tips and common problems

  • After converting, add # comments — YAML supports them, JSON does not.
  • Strings that YAML could misread (yes, 0123) are quoted automatically; keep those quotes.
  • Indent with spaces only if you edit the YAML by hand.

Frequently asked questions

It is easier to read and edit than JSON, supports comments and needs fewer brackets and quotes.

Guides

  • JSON vs XML vs YAML — JSON vs XML vs YAML compared: strengths, weaknesses and best uses, to help you choose the right data format for APIs, config files and documents.