YAML Validator

Check YAML syntax and reformat it cleanly.

0 chars
0 words
0 lines
0 chars
0 words
0 lines

YAML Validator and Formatter Online

The YAML validator checks whether a YAML file parses correctly and, if it does, prints a cleanly re-indented copy of it. It is built for the files people actually break: Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Ansible playbooks, OpenAPI specs, and application configs. Paste the text or open a .yml/.yaml file and the result updates as you type.

What gets checked

The parser follows the YAML 1.2 core schema. It rejects tab characters used for indentation, mappings whose items are indented inconsistently, keys without the required space after the colon, unterminated quoted strings and flow collections, and duplicate keys in the same mapping. When something is wrong you see a precise message such as Line 12, column 5, so you can jump straight to the offending line instead of hunting through a long manifest.

Statistics for valid documents

When the input is valid, a green banner appears together with a structural summary: the number of documents (separated by ---), mappings, sequences, keys, anchors (&name), aliases (*name), and the maximum nesting depth. Unexpectedly high depth or a missing anchor count is often the first hint that an indentation mistake produced a valid but wrong structure.

Formatting options

  • Indentation – rewrite the file with 2 or 4 spaces per level.
  • Sort keys A→Z – order every mapping alphabetically, which makes two versions of a config much easier to compare.

Long strings are never wrapped, and anchors and aliases are resolved into plain values in the formatted copy. Because the output is regenerated from the data, comments are dropped — keep your original if the comments matter.

Everything stays local

Configuration files often contain hostnames, internal URLs, and sometimes secrets. Validation happens entirely in your browser; nothing is sent to a server.

Explore the structure as a tree with the YAML Parser, convert it with YAML to JSON or the multi-format YAML Converter, or go the other way with JSON to YAML.

Frequently Asked Questions

The first problem in the document is shown with its line and column, for example “Line 7, column 3: …”. Typical causes are tabs used for indentation, a missing space after a colon, inconsistent indentation inside a list, or an unclosed quote.

Yes. Two identical keys in the same mapping are reported as invalid, because most YAML loaders silently keep only the last value, which is a frequent source of configuration bugs.

The formatter rebuilds the YAML from the parsed data, so comments and custom quoting are not preserved. Validation itself does not change your input; copy the formatted version only if you want normalized indentation or sorted keys.

Yes. Documents separated by --- are all parsed, and the summary tells you how many documents were found. An error in any of them is reported with its line number in the full file.