๐Ÿ”’ Runs in your browser โ€” nothing is uploadedโœ“ Free, no signup

YAML Formatter & Validator

Paste YAML to check it for errors and format it with consistent indentation. Comments are kept, and errors show the exact line and column.

Loading...

0 characters

Formatted YAML

Loading...

When should you use the YAML Formatter?

  • Checking a Kubernetes manifest, Docker Compose file or GitHub Actions workflow before applying it
  • Fixing indentation errors in a YAML config
  • Making messy or inconsistent YAML tidy and readable

How to use the YAML Formatter

  1. 1

    Paste YAML

    Paste a file or snippet. Multiple documents separated by --- are supported.

  2. 2

    Check validation

    If the YAML is invalid you'll see the line, column and reason.

  3. 3

    Choose formatting

    Pick 2 or 4 spaces and single or double quotes.

  4. 4

    Copy or download

    Copy the formatted YAML or download it as a .yaml file.

Examples

Inconsistent indentation fixed

Before

kind:   Deployment
metadata:
    name: web
    labels: {app: web}

After

kind: Deployment
metadata:
  name: web
  labels: { app: web }

Common errors and how to fix them

bad indentation of a mapping entry
A line is indented by a different amount than its siblings. YAML uses spaces only โ€” check for a tab or an extra space.
Values like yes, no or on changed meaning
Some YAML parsers read yes/no/on/off as booleans. Quote them ("yes") if you mean the text.
Related tools:ย YAML to JSON Converter ยท TOML to JSON Converter ยท JSON Formatter

More from JSON Tools

Free tools that run in your browser โ€” no signup, nothing uploaded.

YAML Formatter FAQ

Yes. Formatting uses Prettier's YAML formatter, which keeps comments, anchors and document separators.

No โ€” YAML only allows spaces for indentation. Tabs cause an error.

It checks that the YAML is syntactically valid. It doesn't check Kubernetes or Compose-specific fields.

YAML is a superset of JSON designed for humans: indentation instead of braces, comments, and less quoting. Use the YAML to JSON converter to switch between them.

Yes. Files with several documents separated by --- are validated and formatted.

No. Everything runs in your browser, so your YAML never leaves your device.