Use YAML Diff Viewer

Enter your data below to use the YAML Diff Viewer

📌 Try these examples:
RESULT

Last updated

YAML Diff Viewer Examples

The YAML Diff Viewer compares two YAML documents structurally, highlighting added, removed, and modified keys at every level. Below are practical examples showing how the diff works across common configuration scenarios.

Basic Key Comparison

Document A (original):

app:
  name: my-service
  version: "1.0.0"
  port: 8080
  debug: false

Document B (updated):

app:
  name: my-service
  version: "1.1.0"
  port: 9090
  debug: true
  timeout: 30

Diff result:

Kubernetes Manifest Comparison

Comparing a Deployment manifest between staging and production:

Staging:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-app
  namespace: staging
spec:
  replicas: 1
  template:
    spec:
      containers:
        - name: web
          image: myapp:1.2.0
          resources:
            requests:
              memory: "128Mi"
              cpu: "250m"

Production:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-app
  namespace: production
spec:
  replicas: 3
  template:
    spec:
      containers:
        - name: web
          image: myapp:1.3.0
          resources:
            requests:
              memory: "256Mi"
              cpu: "500m"

Diff highlights:

Docker Compose Comparison

Original compose file:

version: "3.8"
services:
  db:
    image: postgres:14
    environment:
      POSTGRES_DB: appdb
      POSTGRES_USER: admin
    ports:
      - "5432:5432"

Updated compose file:

version: "3.8"
services:
  db:
    image: postgres:15
    environment:
      POSTGRES_DB: appdb
      POSTGRES_USER: admin
      POSTGRES_PASSWORD: secret
    ports:
      - "5432:5432"
    volumes:
      - db_data:/var/lib/postgresql/data
volumes:
  db_data:

Diff result:

CI/CD Pipeline Comparison

Comparing GitHub Actions workflow files:

Before:

on:
  push:
    branches: [main]
jobs:
  build:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - run: npm install
      - run: npm test

After:

on:
  push:
    branches: [main, develop]
jobs:
  build:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3
      - run: npm ci
      - run: npm test
      - run: npm run build

Diff highlights:

Semantic vs Text Diff

These two YAML documents are semantically identical but formatted differently. A text diff would show many changes; the structural diff shows zero differences:

# Document A
server: {host: localhost, port: 3000}

# Document B
server:
  host: localhost
  port: 3000

Structural diff result: No differences found.

Anchor and Alias Handling

The viewer resolves anchors before comparing:

# Document A
defaults: &defaults
  retries: 3
  timeout: 10
service:
  <<: *defaults
  name: api
# Document B
service:
  retries: 3
  timeout: 10
  name: api

Structural diff result: No differences found (anchors resolved to same values).

Common Use Cases

The YAML Diff Viewer focuses on semantic meaning rather than raw text, so reformatting or reordering keys never creates false positives. Only real value changes appear in the diff output.

Frequently Asked Questions

Simply enter your data, click the process button, and get instant results. All processing happens in your browser for maximum privacy and security.

Yes! YAML Diff Viewer is completely free to use with no registration required. All processing is done client-side in your browser.

Absolutely! All processing happens locally in your browser. Your data never leaves your device, ensuring complete privacy and security.