Free online tool · runs in your browser · no sign-up

Format YAML, instantly.

Paste messy YAML or JSON, and get clean, valid output in real time. Also convert between YAML and JSON instantly.

Formatted YAML will appear here
Valid
|21 lines353 chars|Ctrl+Enter to format|YAML 1.2
Try an example:

Everything you need

A complete YAML toolset

Format, validate, and convert — all in your browser.

Instant Formatting

Beautify messy YAML with perfect indentation in milliseconds. Handles deeply nested structures.

Syntax Validation

Catch errors with precise line and column highlighting. Understand what went wrong instantly.

File Upload & Drag

Drag and drop .yaml or .yml files directly into the editor. No upload, local only.

YAML to JSON

Convert YAML to JSON with one click. Lossless, handles complex nested structures.

Real-time Feedback

See formatted output update as you type. Zero latency, instant visual feedback.

Multi-document

Processes every --- separated document in a file independently.

How it works

Format YAML in three steps

1

Paste or drop a file

Paste YAML from any source — a config file, a CI/CD pipeline, or a Kubernetes manifest. Or drag and drop a .yaml / .yml file into the editor.

2

It formats automatically

A YAML 1.2 parser normalizes indentation, fixes spacing, and flags syntax errors with the exact line — all locally, in milliseconds.

3

Copy, convert, compare

Copy the clean output, switch to the YAML to JSON tab, or use the diff view to compare before and after. Ctrl+Enter formats on demand.

Use cases

YAML everywhere you work

YAML is the backbone of modern infrastructure-as-code. These are the files our formatter cleans up most.

Kubernetes manifests

Deployments, services, configmaps — all defined in YAML. A misplaced space can stop a pod from scheduling. Validate structure and keep indentation consistent.

Docker Compose

Multi-container apps rely on docker-compose.yml. Ensure services, networks, and volumes are nested and readable.

CI/CD pipelines

GitHub Actions, GitLab CI, and CircleCI use YAML workflows. Handles multi-document files and job matrices with ease.

Ansible playbooks

Tasks, handlers, and roles in YAML. Clean formatting keeps complex playbooks maintainable across a team.

Type mapping

YAML to JSON data types

Every YAML value maps to a JSON equivalent. Here is the complete reference, in both directions.

YAML type YAML example JSON type JSON result
StringhelloString"hello"
Integer42Number42
Float3.14Number3.14
BooleantrueBooleantrue
Nullnull / ~Nullnull
Date2025-01-15String"2025-01-15"
Sequence- a
- b
Array["a", "b"]
Mappingkey: valObject{"key": "val"}

Conversion follows the YAML 1.2 spec — strings that look like yes, on, or numbers are quoted automatically so values round-trip exactly.

Real-world examples

DevOps configs, converted

Common configuration files, before and after conversion.

Kubernetes Deployment

YAML
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.25
        ports:
        - containerPort: 80
JSON
{
  "apiVersion": "apps/v1",
  "kind": "Deployment",
  "metadata": {
    "name": "nginx-deployment",
    "labels": { "app": "nginx" }
  },
  "spec": {
    "replicas": 3,
    "selector": {
      "matchLabels": { "app": "nginx" }
    },
    "template": {
      "metadata": {
        "labels": { "app": "nginx" }
      },
      "spec": {
        "containers": [
          {
            "name": "nginx",
            "image": "nginx:1.25",
            "ports": [{ "containerPort": 80 }]
          }
        ]
      }
    }
  }
}

Docker Compose

YAML
version: "3.8"
services:
  web:
    build: .
    ports:
      - "3000:3000"
    environment:
      NODE_ENV: production
    depends_on:
      - db
      - redis
  db:
    image: postgres:15
    volumes:
      - pgdata:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: myapp
  redis:
    image: redis:7-alpine
volumes:
  pgdata:
JSON
{
  "version": "3.8",
  "services": {
    "web": {
      "build": ".",
      "ports": ["3000:3000"],
      "environment": { "NODE_ENV": "production" },
      "depends_on": ["db", "redis"]
    },
    "db": {
      "image": "postgres:15",
      "volumes": ["pgdata:/var/lib/postgresql/data"],
      "environment": { "POSTGRES_DB": "myapp" }
    },
    "redis": {
      "image": "redis:7-alpine"
    }
  },
  "volumes": { "pgdata": null }
}

GitHub Actions workflow

YAML
name: CI
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [18, 20]
    steps:
      - uses: actions/checkout@v4
      - name: Use Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npm test
JSON
{
  "name": "CI",
  "on": {
    "push": { "branches": ["main"] },
    "pull_request": { "branches": ["main"] }
  },
  "jobs": {
    "test": {
      "runs-on": "ubuntu-latest",
      "strategy": {
        "matrix": { "node-version": [18, 20] }
      },
      "steps": [
        { "uses": "actions/checkout@v4" },
        {
          "name": "Use Node.js",
          "uses": "actions/setup-node@v4",
          "with": { "node-version": 20 }
        },
        { "run": "npm ci" },
        { "run": "npm test" }
      ]
    }
  }
}

Frequently asked questions