DevToolPal
EN

YAML Formatter & Validator

Check YAML syntax, list every error with its line and column, and reformat valid YAML with consistent indentation.

Runs locally, never uploaded

Options

Indent

YAML

0 chars · 0 B

Validation

Result appears here

What it does

YAML is popular for configuration files — Kubernetes manifests, GitHub Actions and GitLab CI workflows, Docker Compose, Ansible playbooks, OpenAPI documents — because it is easy to read. It is also easy to break: a single wrong indent, a tab, an unclosed quote or a missing space after a colon can change the meaning of a file or make it fail to load.

This validator parses your YAML and reports every syntax error with its line and column, plus warnings such as unknown directives. When the YAML is valid, it shows the number of documents and the type of each root value, and can print a cleanly reformatted copy with consistent indentation.

How to use

  1. Paste YAML into the input, upload a .yaml or .yml file, or click Sample.
  2. The result appears as you type: a green Valid YAML badge, or a list of errors such as Line 3, column 2.
  3. Keep Show formatted YAML on to get a tidy copy, and choose 2 or 4 spaces of indentation. Copy it with the button above the block.
  4. Turn off Duplicate keys are errors only if your tooling allows repeated keys.

Common mistakes

server:
  port: 8080
   host: localhost   # indented one space too far
tags: [web, api      # missing closing bracket
  • Inconsistent indentation: items at the same level must start in the same column. YAML does not allow tabs for indentation.
  • Missing space after a colon: key:value is a plain string, not a key and value.
  • Unquoted special characters: values that begin with *, &, !, %, @ or a backtick, or that contain : or #, need quotes.
  • Unexpected types: yes, no, on and off are strings in YAML 1.2 but booleans in older YAML 1.1 parsers; quote them to be safe. Version numbers like 1.10 become the number 1.1 unless quoted.

Validating structure

This tool checks syntax: whether the text is well-formed YAML. To check that a file has the right keys and value types, convert it with the YAML to JSON tool and validate the result with the JSON Schema Validator.

FAQ

› Which YAML version does the validator follow?

YAML 1.2, the current version used by most modern tools. Inputs with several documents separated by --- are checked document by document.

› Why are duplicate keys reported as errors?

The YAML specification requires keys in a mapping to be unique, and many parsers silently keep only the last value, which hides mistakes. If your tool accepts duplicates on purpose, turn off Duplicate keys are errors.

› Does formatting keep my comments?

Yes. Comments, key order, anchors and quoted strings are preserved; only indentation and spacing are normalized. Long strings are not wrapped.

› Is my YAML uploaded anywhere?

No. Parsing happens in your browser, so configuration files with secrets never leave your computer.