Convert JSON to YAML Online

Convert JSON to YAML online: paste your JSON code or upload a .json file, press Convert, and get the same data in YAML format. Values such as yes, on and 0777 are quoted, so every YAML parser reads them as strings. The conversion runs in your browser, and nothing is uploaded to the Internet. It's free.

About Online JSON to YAML Converter

The JSON to YAML Converter reads JSON and writes the same data in YAML format. Use it to turn an API response, a JSON config or an OpenAPI spec into YAML for Kubernetes, Docker Compose, Ansible or a CI pipeline.

  • Convert JSON to indented YAML
  • Quote values that a YAML parser could read as another type
  • Fix common JSON errors before converting: single quotes, unquoted keys, trailing commas and comments
  • Highlight JSON syntax errors with a built-in JSON linter
  • View the data as a tree
  • Upload a .json file and download the YAML as a .yaml file
  • Free to use

Is JSON valid YAML?

Yes. YAML is a superset of JSON, so any JSON file converts to YAML one to one. In YAML, the same data uses indentation instead of braces, needs fewer quotes, and can carry comments. The YAML to JSON Converter does the reverse.

How to convert JSON to YAML online?

Paste your JSON code, or press Upload to open a .json file, then press Convert. Copy the result or press Download to save it as data.yaml. If the JSON is invalid, Fix repairs common errors, as the JSON Fixer does, and converts the result.

JSON to YAML Example

In the Kubernetes ConfigMap below, on and 0755 are strings. The converter quotes them, so parsers such as PyYAML read them as strings too, not as a boolean and a number.

JSON Input
{
  "apiVersion": "v1",
  "kind": "ConfigMap",
  "metadata": {
    "name": "app-config"
  },
  "data": {
    "DEBUG": "on",
    "MODE": "0755",
    "WELCOME": "Hello\nWorld"
  }
}

YAML Result
apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
data:
  DEBUG: "on"
  MODE: "0755"
  WELCOME: |-
    Hello
    World

JSON to YAML Conversion Rules

  • Objects become mappings, and arrays become lists of dashes.
  • Strings are written without quotes unless YAML would read them as another type: "yes", "on", "0777" and "2026-11-11" keep their quotes.
  • Strings with line breaks become literal blocks marked |-.
  • true, false and null stay as they are; long integers keep every digit.
  • An empty string becomes "".
Updated: