DeveloperKit

JSON to YAML Converter

Convert JSON to clean, readable YAML instantly. Free, private, and 100% in your browser.

Input JSON

YAML Output

YAML output will appear here.

Convert JSON to YAML Online

YAML is the format of choice for configuration: Kubernetes manifests, Docker Compose files, CI/CD pipelines, and many application configs are written in it. This tool converts JSON, such as an API response or a generated config, into idiomatic YAML that is ready to commit.

Features

  • Readable block style

    Nested objects and arrays use clean, indented block YAML, the style used in most configuration files.

  • Safe quoting

    Strings that YAML would misread, such as "yes", "no", "1.0", or dates, are quoted so their type never changes.

  • Multi-line strings

    Strings with line breaks are written as readable literal blocks (|) instead of long escaped lines.

  • Works everywhere

    Output is valid YAML 1.2 and also reads correctly in older YAML 1.1 parsers.

  • Live validation

    Your JSON is validated as you type, with the exact line and column of any error.

  • Private by design

    The conversion runs entirely in your browser. Your data is never uploaded.

JSON to YAML Example

JSON input
{
  "apiVersion": "apps/v1",
  "kind": "Deployment",
  "metadata": { "name": "web", "labels": { "app": "web" } },
  "spec": {
    "replicas": 3,
    "enabled": "yes",
    "containers": [
      { "name": "web", "image": "nginx:1.27", "ports": [80, 443] }
    ]
  }
}
YAML output
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
  labels:
    app: web
spec:
  replicas: 3
  enabled: "yes"
  containers:
    - name: web
      image: nginx:1.27
      ports:
        - 80
        - 443

Note that "yes" stays quoted, so YAML does not turn it into the boolean true.

How to Convert JSON to YAML

  1. Paste your JSON into the input editor, or upload a .json file.
  2. Choose 2 or 4 spaces of indentation.
  3. The YAML output updates instantly as you type.
  4. Copy the YAML or download it as a .yaml file.

Frequently Asked Questions

Why are some strings quoted in the YAML output?

In YAML, unquoted values such as yes, no, on, off, null, 1.0, or 2026-01-15 are read as booleans, null, numbers, or dates. To keep them as strings, exactly as in your JSON, the converter wraps them in double quotes.

Is every JSON document valid YAML?

Yes. YAML 1.2 is a superset of JSON, so JSON is technically valid YAML. Converting to block-style YAML makes it far easier to read and edit, which is why tools like Kubernetes and Docker Compose prefer it.

Can I use the output for Kubernetes or Docker Compose?

Yes. The output is standard block-style YAML that works with kubectl, Helm, Docker Compose, GitHub Actions, GitLab CI, Ansible, and other YAML-based tools.

Should I use 2 or 4 spaces of indentation?

Two spaces is the most common convention, used by Kubernetes and most CI systems. Both options produce valid YAML, so pick the one that matches your project.

Is my JSON uploaded anywhere?

No. The converter runs entirely in your browser using JavaScript. Your JSON never leaves your device.

  • JSON to XML

    Convert JSON to well-formed XML with custom root and item names, attributes, and indentation.

  • JSON to CSV

    Turn JSON arrays into CSV for Excel or Google Sheets, with nested object flattening and custom delimiters.

  • JSON to Base64

    Encode JSON as Base64 or base64url for headers, tokens, environment variables, and data URIs.

  • Base64 to JSON

    Decode Base64 or base64url back into readable, validated, and pretty-printed JSON.