JSON to YAML

Convert JSON into readable YAML for Kubernetes, CI and config files.

JSON Runs in your browser
JSON
YAML

Nothing converted yet

Paste JSON on the left to see it as YAML, ready for a Kubernetes manifest or a CI config.

Runs entirely in your browser. Your data isn't uploaded — this page makes no network request with anything you type, which you can verify in your browser's network tab. How this works.

What is the JSON to YAML?

YAML is what most infrastructure config is written in, and JSON is what most tools emit. Converting between them comes up constantly: turning a Terraform output into a Helm value file, a captured API response into a fixture, or a JSON policy document into something reviewable.

Because JSON is a subset of YAML, the conversion is lossless in this direction. The interesting part is presentation: how much to indent, when to quote, how to render multi-line strings so the result reads like YAML a person would write.

How to use it

  1. Paste JSON into the left editor, or upload a .json file.
  2. Choose indentation and whether to quote strings only when required.
  3. Press Convert (or Ctrl/Cmd + Enter).
  4. Copy the YAML, or download it as a .yaml file.

Example

A JSON object rendered as YAML.

Input
{"service":{"name":"api","port":8080,"env":["prod"]}}
Result
service:
  name: api
  port: 8080
  env:
    - prod

Features

  • Lossless conversion — JSON is a strict subset of YAML 1.2
  • 2-space or 4-space indentation
  • Multi-line strings emitted as literal blocks for readability
  • Automatic quoting of values that would otherwise change type, such as yes, no, on, off and 1.0
  • Optional document start marker (---)

Frequently asked questions

Why did my string get quoted?
Because unquoted it would parse as something else. In YAML, yes, no, on, off, true, null and ~ are not plain strings, and a value like 08 or 1.0 becomes a number. Quoting preserves the JSON meaning.
Will comments be preserved?
JSON has no comments, so there are none to carry over. Going the other way, YAML comments are lost — that is a property of the formats, not this tool.
Is the conversion safe for Kubernetes manifests?
Yes, and it is a common use. Note that Kubernetes cares about key order only for readability, so feel free to reformat freely.
Esc

Loading the catalog…