Tools

Home
JSON FormatterSQL FormatterJS ValidatorMinify CSS
Merge PDFCompress PDFImage to PDF
JPG to PNGPNG to WebPCrop Image

Edit YAML Online

Edit YAML data in a clean online editor with syntax validation. Format, minify, and validate as you type. 100% client-side.

Your files never leave your browser
YAML Editor0 chars, 0 lines
1
Error:
    Ready·

    Paste in your YAML, validate it against the 1.2 spec, and fix indentation issues — all with line numbers so you can actually find the problem. Format standardizes spacing in one click, and Minify collapses everything into flow notation when you need a single-line value. And everything runs in your browser. Nothing gets uploaded.

    How It Works

    Paste YAML
    →
    Parse & Validate
    →
    Format / Minify / Copy

    The editor uses the js-yaml library under the hood. When you click Validate, it parses your entire document against the YAML 1.2 spec and flags the exact line if something's off. Format re-serializes the parsed data with clean, consistent indentation (2 or 4 spaces — your choice). Minify does the opposite: it collapses everything into flow notation for the smallest possible output.

    Examples

    Fixing messy Docker Compose indentation

    Someone copied a docker-compose.yml from Stack Overflow and the spacing got wrecked.

    INPUT
    services: web: image: nginx:latest ports: - "80:80" db: image: postgres:15 environment: POSTGRES_PASSWORD: secret
    OUTPUT
    services: web: image: nginx:latest ports: - '80:80' db: image: postgres:15 environment: POSTGRES_PASSWORD: secret

    Minifying a GitHub Actions workflow for embedding

    You need to pass a YAML snippet as a single-line string value inside another config.

    INPUT
    name: CI on: push: branches: - main jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
    OUTPUT
    {name: CI, on: {push: {branches: [main]}}, jobs: {build: {runs-on: ubuntu-latest, steps: [{uses: 'actions/checkout@v4'}]}}}

    Validating a Kubernetes deployment manifest

    Before applying to a cluster, catch syntax issues that kubectl would reject.

    INPUT
    apiVersion: apps/v1 kind: Deployment metadata: name: my-app spec: replicas: 3 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: app image: myregistry/app:1.2.0 ports: - containerPort: 8080
    OUTPUT
    ✓ Valid YAML Parsed successfully with correct indentation and structure. Ready to apply.

    Who Uses This

    👨‍💻 DevOps Engineers

    Cleaning up Kubernetes manifests, Helm charts, and Ansible playbooks before deploying.

    🔧 Backend Developers

    Debugging Spring Boot application.yml or docker-compose files that refuse to parse.

    🚀 CI/CD Engineers

    Validating GitHub Actions and GitLab CI pipeline configs before committing.

    📚 Students

    Learning YAML syntax for cloud certifications or first-time Docker setups.

    Common Mistakes

    Mixing tabs and spaces

    YAML only allows spaces for indentation. A single tab character will break the entire file. If you pasted from an editor that uses tabs, run Format here first — it converts everything to spaces automatically.

    Forgetting to quote strings with special characters

    Values like password: p@ss:word! break because : and @ are reserved. Wrap them in quotes: password: "p@ss:word!". The validator will catch this, but knowing why saves time.

    Wrong indentation level for list items

    List items (lines starting with -) need to be indented under their parent key. A common mistake is aligning the dash with the key instead of indenting it two spaces deeper. The error message usually says "bad indentation" but doesn't always make clear which line to fix.

    Technical Details

    Frequently Asked Questions

    Are comments preserved when I format or minify?

    No. Formatting and minifying parse the YAML into a data structure, then re-serialize it. Comments get stripped during that process. If you only click Validate, your text stays untouched — comments and all.

    Can I edit multi-document YAML files here?

    The editor handles single-document YAML. If your file has multiple documents separated by ---, split them and validate each one separately. Most config files are single-document anyway.

    What is the difference between YAML and JSON?

    YAML uses indentation instead of braces, supports comments, and is generally easier to read for humans. JSON is stricter and more widely supported by APIs. Fun fact: valid JSON is actually valid YAML, so you can paste JSON into this editor and it will parse fine.

    Is my YAML data sent to a server?

    Nope. Everything happens in your browser using JavaScript. Your data stays on your machine. There are no server calls, no analytics on your content, nothing leaves the page.

    Why does my YAML fail with "unexpected end of stream"?

    That usually means you have an unclosed quote or a multi-line string that is missing its block indicator (| or >). Check the line number in the error — it points to where the parser gave up. Nine times out of ten, the actual problem is a few lines earlier.

    Share: