YAML to JSON 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 YAML to JSON?

To convert YAML to JSON, paste the YAML above, open Convert and press To JSON in the YAML section. You get formatted JSON with two space indentation, and if the YAML has a syntax error you'll see the error instead of a half converted file.

Anchors and aliases are expanded into full copies, and comments are dropped since JSON has nowhere to keep them. Keys like on stay as strings, which matters for GitHub Actions workflows like the one in the example.

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

Example

YAML
name: CI
on:
  push:
    branches: [main]
  pull_request:
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 22
      - run: npm ci
      - run: npm test
JSON
{
  "name": "CI",
  "on": {
    "push": {
      "branches": [
        "main"
      ]
    },
    "pull_request": null
  },
  "jobs": {
    "test": {
      "runs-on": "ubuntu-latest",
      "steps": [
        {
          "uses": "actions/checkout@v4"
        },
        {
          "uses": "actions/setup-node@v4",
          "with": {
            "node-version": 22
          }
        },
        {
          "run": "npm ci"
        },
        {
          "run": "npm test"
        }
      ]
    }
  }
}

Questions people ask

Why won't my YAML convert?

Usually it's indentation. YAML uses spaces for structure, tabs aren't allowed for indenting, and one misaligned line changes the meaning. Press Validate with the YAML tab open to see the parser's message, which points at the line and column.

What about files with several documents?

One document at a time. If the file has several documents separated by ---, convert them one by one.

Are dates converted?

Dates come through as strings, exactly as they were written, so nothing gets shifted by time zones.

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 guideJSON vs YAML: Which Format Should You Use?