JSON to YAML converter

What is a Json To Yaml Converter?

YAML is the configuration language of modern DevOps: Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Ansible playbooks and OpenAPI specs. It expresses the same data as JSON but with indentation instead of braces, which is easier for people to read and edit. This converter turns JSON into YAML as you type.

How to use it

  1. Paste JSON.
  2. Copy the YAML output.

Example

Input (double quotes in real JSON):

{ 'apiVersion': 'v1', 'kind': 'Service', 'metadata': { 'name': 'web' }, 'spec': { 'ports': [ { 'port': 80, 'targetPort': 8080 } ] } }

Output:

apiVersion: v1
kind: Service
metadata:
  name: web
spec:
  ports:
    - port: 80
      targetPort: 8080

JSON is already valid YAML

YAML 1.2 is a superset of JSON, so YAML parsers can read JSON directly. Converting is about readability, not compatibility.

Gotchas when editing the result

  • Indentation is syntax. Use spaces, never tabs, and keep nesting consistent.
  • Strings that look like other types: values such as yes, no, on, off were booleans in YAML 1.1, and 1.10 is a number. Good converters quote such strings; keep the quotes, for example on version numbers and country codes like NO.
  • Leading zeros: a ZIP code like 01234 must stay quoted to remain a string.
  • Comments can be added with # in YAML, something JSON cannot do.

Conversion happens locally, so it is safe for configuration that contains internal hostnames.

Frequently Asked Questions

Is JSON valid YAML?

Yes. YAML 1.2 is a superset of JSON, so YAML parsers accept JSON documents.

Why are some values quoted in the YAML output?

Strings that YAML could misread as booleans, numbers or null are quoted to keep them as strings.

Can I use tabs in YAML?

No. YAML indentation must use spaces.

Can I add comments after converting?

Yes. YAML supports comments starting with a hash sign, unlike JSON.