Skip to content

YAML Validator

Check YAML for syntax errors before it breaks a deployment or a CI pipeline. The validator parses every document in the input with a YAML 1.2 parser, rejects duplicate keys, tabs used for indentation and runaway alias expansion, and reports the first error with its document, line and column. Valid input shows the number of documents, the top-level type of each and any warnings. Made for Kubernetes, Docker Compose and config authors.

Reset

Frequently asked questions

What does the YAML validator check?

It parses the full YAML syntax: indentation, block and flow collections, quoted and plain scalars, anchors, aliases, tags and directives. It also treats duplicate keys in a mapping as an error. The result is either a confirmation with a short summary or the first error with its position and an explanation.

Which YAML version does it follow?

The validator uses the YAML 1.2 core schema, the current version of the specification. Under 1.2, words such as yes, no, on and off are ordinary strings rather than booleans, so they never cause an error. Documents written for YAML 1.1 tools are still accepted as long as their syntax is valid.

Why are duplicate keys reported as errors?

The YAML specification requires keys in a mapping to be unique. Many parsers silently keep the last value, which hides configuration mistakes such as a setting defined twice. The validator reports the line and column of the repeated key so you can decide which value to keep.

How are line, column and document numbers counted?

Lines and columns start at 1 from the beginning of the input you paste. Documents are counted in the order they appear, separated by --- lines, so the first document is document 1. The position points to where the parser detected the problem, which can be right after the actual mistake.

Can I validate several YAML documents at once?

Yes. Separate the documents with --- as in a multi-document Kubernetes manifest and every document is parsed. A valid result shows the number of documents and the top-level type of each one.

What does the top-level type mean?

It tells you what each document contains at its root: a mapping of keys and values, a sequence of items, a single scalar value or nothing at all. Most configuration files are mappings, while lists of resources are often sequences. A wrong type here usually means a misplaced dash or indentation.

What are warnings?

Warnings are problems that do not stop parsing, for example a tag the parser does not know, which is then read as a plain value. Each warning is listed with its line and column, up to 20 of them. A document with warnings still counts as valid.

Why are tabs rejected?

YAML forbids tab characters for indentation because their width is ambiguous. Replace the tabs at the start of the reported line with spaces and keep the indentation consistent with the surrounding lines. Tabs inside values and quoted strings are allowed.

Is it protected against alias bombs?

Yes. Aliases may expand at most 100 times, so a document built to multiply aliases into gigabytes of data, often called a billion laughs attack, is reported as invalid instead of exhausting memory. Normal use of anchors and aliases for shared settings stays well below this limit.

Does it validate against a schema such as Kubernetes or OpenAPI?

No, it checks syntax and structure only, not whether the keys and values match a particular schema. Inputs can be up to 5 MiB. To turn valid YAML into JSON, TOML or another format, use the Data Format Converter.

About OneClick Pro

OneClick Pro is a free collection of more than 150 web tools for everyday work: converting images and units, formatting and validating code, checking domains and SEO, and working with text, dates and numbers. Every tool runs without registration or subscription, and what you enter is only used to calculate your result and is never stored. Use it as a quick toolbox for one-off tasks, or bookmark the tools you rely on every day.