ZapKit

YAML Validator & Formatter

Check a YAML file for syntax errors, see the exact line where it breaks, and get it back neatly formatted or as JSON.

What is a YAML validator?

YAML is a human-friendly data format built on indentation, the standard for configuration in Docker Compose, Kubernetes, Ansible, GitHub Actions, CI pipelines and OpenAPI specs. Because whitespace carries meaning, a single extra space can stop a deployment or silently move a setting under the wrong parent.

A YAML validator parses the file the same way your tools will and tells you whether it's valid, and if not, exactly where it breaks. This one also reformats valid YAML with consistent indentation and can show the parsed data as JSON, so you can confirm every key and value lands where you intended.

How to use the YAML Validator

  1. 1.Paste your YAML

    Docker Compose, Kubernetes, GitHub Actions, OpenAPI or any config file.

  2. 2.Read the verdict

    Valid YAML is reformatted; an error shows its line and column.

  3. 3.Choose the output

    Formatted YAML with 2 or 4 spaces, or the same data as JSON.

Example: an app config with two servers

A file with an app section (name, port 8080, debug false) and a list of two servers with host and weight:

Status
Valid YAML
Documents
1
As JSON
"port": 8080 and "debug": false, a number and a boolean
With b: indented one space
Invalid YAML (line 1, column 4)

The valid file passes; shifting one key by a single space is caught with its position.

Errors with a line number

YAML relies on indentation, so one misaligned space changes the meaning or breaks the file. The validator uses the yaml library, which follows the YAML 1.2 specification, and reports the first problem with its line and column, such as a nested mapping where a value was expected or a tab used for indentation.

Files with several documents separated by --- are checked one by one. Converting to JSON shows exactly how a program will read the data, which is the fastest way to discover that a value like 1.10 or an unquoted date isn't the type you expected.

Frequently asked questions

Can YAML use tabs?

No. YAML indentation must use spaces. A tab gives an error.

Why is my value a string instead of a number?

Convert to JSON to see the types. Quoted values are always strings, and YAML 1.2 treats yes, no, on and off as plain strings, unlike older YAML 1.1 tools.

Does formatting keep my comments?

Yes. Comments are kept when the output is YAML. JSON has no comments, so they're dropped there.

Does it check Kubernetes or Compose rules?

No. It checks YAML syntax, not whether the keys are right for a particular tool.

More Developer tools