Skip to content
XUtilHub

YAML Validator & Formatter – Check YAML Syntax Online

Validate YAML and find syntax errors with line and column numbers, then reformat it with consistent indentation. Great for Docker Compose, Kubernetes and CI files.

  • Free, no sign-up
  • Runs in your browser, nothing uploaded
YAML
Formatted YAML

About the YAML Validator

Check YAML for syntax errors and reformat it cleanly. Errors show the exact line and column, which helps with Docker Compose, Kubernetes, GitHub Actions and other config files.

Key features

  • Finds YAML syntax errors with line and column
  • Reformats with consistent indentation
  • Keeps comments and original quoting
  • Multi-document files (---) supported
  • Optional key sorting
  • Private: config files stay in your browser

Check YAML before you deploy

A single misplaced space can break a Docker Compose file, a Kubernetes manifest or a GitHub Actions workflow. Paste your YAML to find syntax errors instantly, then get a cleanly formatted version.

Common YAML mistakes

MistakeExampleFix
Inconsistent indentation2 spaces in one block, 3 in the nextUse the same number of spaces
Tab characters→key: valueReplace tabs with spaces
Missing space after colonkey:valuekey: value
Unquoted special characterstitle: Hello: Worldtitle: "Hello: World"
Port numbers like 80:80- 80:80Quote them: - "80:80"

Some older YAML 1.1 parsers read unquoted values like 22:22 as base-60 numbers, which is why Docker recommends quoting port mappings.

YAML to JSON, JSON to YAML, and JSON validator.

How to use the YAML Validator

  1. Paste your code into the input box, upload a file, or click Sample to try it out.
  2. Choose the options you want, such as indentation, line width or dialect.
  3. The result appears instantly in the output panel. Syntax errors are shown with their line and column.
  4. Click Copy to copy the result, or Download to save it as a file.

Frequently asked questions

Why is my YAML invalid?

The most common causes are inconsistent indentation, tabs instead of spaces, a missing space after a colon, and unquoted values containing special characters such as : or #. The error message points to the line and column.

Can I use tabs in YAML?

No. YAML only allows spaces for indentation. Tabs cause a syntax error.

Does formatting keep my comments?

Yes, comments and the original quoting are kept. The only exception is 'Sort keys', which rebuilds the document and therefore removes comments.

Does it check Kubernetes or Docker Compose schemas?

It checks YAML syntax, not whether the keys are valid for a particular tool. A file can be valid YAML and still be rejected by Kubernetes or Docker if a key name is wrong.

Is my code uploaded anywhere?

No. Every developer tool runs entirely in your browser, so source code, configuration files and passwords never leave your device.

Which formatter do you use?

HTML, CSS and JavaScript are formatted with Prettier, the most widely used code formatter, so the output matches what most projects use. SQL uses sql-formatter, and minification uses Terser and CSSO.

Is there a size limit?

There's no fixed limit. Very large files (several megabytes) can take a few seconds, depending on your device.

Last updated:

Related Dev tools