FormatPaste

JSON to YAML Converter

Paste JSON and copy the same data as clean, readable YAML.

Ready
All formatters

Input

Don't paste secrets · formatting is not stored

Output

yaml

Free JSON to YAML converter

Convert JSON to YAML online

Use this JSON to YAML converter when a tool gives you JSON but your config needs YAML: Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Helm values, or app settings. Paste JSON on the left and copy YAML from the right.

Convert JSON to YAML

Objects become nested keys and arrays become "- item" lists with consistent indentation.

Validated first

The JSON is parsed strictly before converting, so syntax errors are reported instead of converted.

Copy or download

Copy the YAML or download it as a .yaml file ready to commit.

JSON to YAML example

Before
{"apiVersion":"v1","kind":"Service","metadata":{"name":"web"},"spec":{"ports":[{"port":80,"targetPort":8080}]}}
After
apiVersion: v1
kind: Service
metadata:
  name: web
spec:
  ports:
    - port: 80
      targetPort: 8080

When to convert JSON to YAML

Kubernetes manifests

kubectl can print resources as JSON, but most teams keep manifests in YAML. Convert JSON output from kubectl or an API into YAML you can edit and commit.

Docker Compose and CI files

Docker Compose, GitHub Actions, GitLab CI, and many other tools are configured in YAML. Convert JSON examples from docs or generators into the format the tool expects.

More readable config

YAML drops the braces, brackets, and most quotes, which makes long config files easier to read and review in pull requests.

Comments after converting

JSON has no comments, but YAML does. After converting, you can add # comments to explain settings, which JSON config files cannot do.

JSON to YAML Converter FAQ

How do I convert JSON to YAML?

Paste JSON into the input pane. The YAML version appears on the right automatically, ready to copy or download.

Is this JSON to YAML converter free?

Yes. It is free to use with no sign-up.

Does converting change my data?

No. YAML is a superset of JSON, so every JSON value has an exact YAML equivalent. Strings that could be misread, such as "yes", "08", or "1.0", are quoted in the output so they stay strings.

Can I choose the YAML indentation?

Yes. Pick 2 or 4 spaces from the Indent menu. YAML does not allow tabs for indentation, so the tabs option uses two spaces.

Why are some strings quoted in the YAML?

Quotes are only added where YAML would otherwise read the value as something else, such as a number, a boolean, null, or a string containing a colon followed by a space.

Can I convert YAML back to JSON?

Not on this page yet. To tidy YAML itself, use the YAML Formatter.