YAML to JSON

Input
Output

YAML to JSON Converter

Paste YAML and get clean, formatted JSON. Bracely reads anchors, aliases, multi-line strings and comments, and points out YAML errors by line.

Example: a GitHub Actions workflow

A workflow file with a nested trigger, a flow-style list and a list of steps. Note the on: key: it stays the string "on", where older YAML 1.1 parsers turn it into true:

Input

name: CI
on:
  push:
    branches: [main]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - run: npm ci && npm test

Output

{
  "name": "CI",
  "on": {
    "push": {
      "branches": [
        "main"
      ]
    }
  },
  "jobs": {
    "test": {
      "runs-on": "ubuntu-latest",
      "steps": [
        {
          "uses": "actions/checkout@v5"
        },
        {
          "run": "npm ci && npm test"
        }
      ]
    }
  }
}

How do I use the YAML to JSON?

  1. Paste YAML or open a .yaml or .yml file.
  2. The JSON appears in the Output box.
  3. Copy it, save it, or keep working on it with any other tool.

What does the YAML to JSON do?

  • Anchors and aliases expanded
  • Multi-line strings kept intact
  • Switch direction for JSON to YAML
  • Works with Kubernetes, Compose, GitHub Actions and OpenAPI files

When to use the YAML to JSON

YAML is what Kubernetes manifests, Docker Compose files, GitHub Actions workflows, OpenAPI specs and Ansible playbooks are written in. Converting to JSON lets you query them with jq or JSONPath, compare two versions with Diff, check them against a JSON Schema, or pass them to a tool that only reads JSON.

Bracely reads YAML 1.2, so on, yes and no stay strings instead of becoming true or false, and a date like 2026-10-29 stays text. Anchors, aliases and << merge keys are expanded into full copies, and block strings (| and >) keep their line breaks. A file with several documents separated by --- needs to be converted one document at a time.

Frequently asked questions

Why does on: stay "on" instead of true?
In YAML 1.1, on, off, yes and no were booleans, which turned GitHub Actions' on: key into true. YAML 1.2 dropped that, and Bracely follows it, so keys and values keep the words you wrote.
Can it convert a file with several documents?
Not in one go: it expects a single document. Paste each part between the --- lines separately, or use JSON → YAML on each result to put them back together.
Are YAML comments kept?
No. JSON has no comments, so they are dropped.
Is my data uploaded?
No. Bracely runs entirely in your browser, so nothing you paste or open leaves your device.

More JSON tools

Bracely has 108 JSON tools in one page. Related ones:

Runs entirely in your browser. Nothing you paste is uploaded. Made by Saurabh Pagrut · About · Privacy policy
Last updated · Version 6.7 · Changelog
Saurabh Pagrut on GitHub · LinkedIn · X · YouTube · Instagram