Skip to content
Devtoolry

JSON to YAML

Convert JSON to clean, human-readable YAML online. Turn API responses and package files into config for Kubernetes, Docker Compose or CI pipelines.

Runs in your browser · Nothing uploadedFree · No sign-up

Something not working, or missing a feature? Send feedback

About the JSON to YAML

YAML is easier for people to read and edit than JSON, which is why tools like Kubernetes, Docker Compose and GitHub Actions use it. This converter turns JSON into clean YAML.

Conversion happens in your browser, so your files and records stay private.

How to use the JSON to YAML

  1. Paste JSON.
  2. Choose the indentation.
  3. Copy or download the YAML.

Example

Turn a JSON deployment into YAML

Input

{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"name":"web"},"spec":{"replicas":2,"template":{"spec":{"containers":[{"name":"web","image":"nginx:1.27","ports":[{"containerPort":80}]}]}}}}

Result

apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
spec:
  replicas: 2
  template:
    spec:
      containers:
        - name: web
          image: nginx:1.27
          ports:
            - containerPort: 80

Arrays of objects become "- " list items, and strings are quoted only where needed.

Common mistakes

  • Strings that look like other types. Values such as "yes", "1.10" or "08:00" must stay quoted in YAML or other parsers may read them as booleans, numbers or times. The converter quotes them for you; keep the quotes when editing.
  • Editing with tabs. If you edit the YAML afterwards, indent with spaces. YAML does not allow tabs for indentation.
  • Expecting comments. JSON has no comments, so the YAML has none either. Add them after converting.

Works well with the JSON to YAML

Frequently asked questions

Are strings quoted?

Only when needed, for example values that would otherwise be read as numbers, booleans or dates.

Is the conversion lossless?

Yes. Converting the YAML back to JSON gives the same data.

Will kubectl accept the output?

Yes. Kubernetes reads YAML and JSON the same way, so the converted manifest is equivalent to the JSON one.

Is the key order kept?

Yes. Keys appear in the same order as in the JSON.

Guides and tutorials