JSON to YAML Converter

Skip to editor
Explorer
Open Files

No files open

0 files open

jsoneditor.io v2

No file open

Create a new file or open an existing one from the sidebar

JSONUTF-8
Spaces: 2

How do I convert JSON to YAML?

To convert JSON to YAML, paste your JSON above, open Convert and press To YAML. The tab switches to YAML with the same data, nested objects become indented blocks and arrays become dash lists, and To JSON in the same panel converts it straight back.

Values that older YAML parsers would misread get quoted, so a country code like NO stays a string and a port mapping like 22:22 doesn't turn into a number. Look at the example below, those are real gotchas in Docker Compose files.

  1. Paste your JSON into the editor.
  2. Open Convert and press To YAML.
  3. Copy the YAML, or press Save to download it.

Example

JSON
{
  "services": {
    "web": {
      "image": "node:22-alpine",
      "ports": [
        "3000:3000",
        "22:22"
      ],
      "environment": {
        "NODE_ENV": "production",
        "COUNTRY": "NO"
      },
      "depends_on": [
        "db"
      ]
    },
    "db": {
      "image": "postgres:16",
      "volumes": [
        "db-data:/var/lib/postgresql/data"
      ]
    }
  },
  "volumes": {
    "db-data": {}
  }
}
YAML
services:
  web:
    image: node:22-alpine
    ports:
      - 3000:3000
      - "22:22"
    environment:
      NODE_ENV: production
      COUNTRY: "NO"
    depends_on:
      - db
  db:
    image: postgres:16
    volumes:
      - db-data:/var/lib/postgresql/data
volumes:
  db-data: {}

Questions people ask

Will values like no, yes, on and off stay strings?

Yes. Older YAML parsers, including PyYAML and plenty of Go tools, read an unquoted no as false, which is the famous Norway problem. The converter quotes those values, along with dates and numbers that are stored as strings, so the YAML means the same thing whichever parser reads it.

Is YAML a superset of JSON?

Yes, YAML 1.2 is a superset of JSON, so any valid JSON is also valid YAML. Converting mostly swaps braces, brackets and quotes for indentation.

Can I convert YAML back to JSON?

Yes, press To JSON in the YAML section of the Convert panel.

Is my data uploaded anywhere?

No, this runs entirely in your browser, so nothing you paste is sent to a server. The only feature that sends data anywhere is the optional AI assistant, and only when you actually ask it something.

Read the guideHow to Convert JSON to YAML (and YAML to JSON)