How to use the YAML Validator
- 1. Paste your YAMLAny config: Compose, Kubernetes, CI workflows or your own data.
- 2. ValidateThe parser loads it in your browser and reports the first error it finds.
- 3. Convert or fixDownload the JSON or reformatted YAML once it is valid.
The sample has a mistake
The example Compose file looks fine at a glance, but restart: always under db is indented with three spaces while image: above it uses four. YAML uses indentation to decide what belongs to what, so the parser stops with line 10, column 4: bad indentation of a mapping entry. Add one space and it validates as 1 document, and the JSON view shows services, web and db as nested objects.
Indentation errors and tabs cause most YAML problems. The tool also warns if any line starts with a tab, which YAML does not allow for indentation.
What validation can and cannot tell you
- It checks syntax: indentation, colons, quotes, lists and multi-document files separated by ---.
- It does not check schema: a Kubernetes file with a misspelt key like
contianersstill parses. Use kubectl apply --dry-run=server or your tool's own validation for that. - Values like
no,onor3.10can be read as false, true or 3.1 by some tools. Quote them when they are meant as text.
Parsing uses js-yaml 4.1.0 (YAML 1.2), loaded from cdnjs.cloudflare.com the first time you validate, and your YAML is never uploaded. Generate files to check with the Kubernetes YAML generator or the Docker Compose generator, and tidy JSON with the JSON formatter.
Frequently asked questions
Why does YAML not allow tabs?
The YAML specification forbids tabs for indentation because different editors show them at different widths, which would change the meaning.
Is my YAML sent anywhere?
No. The parser library is downloaded once from cdnjs; your text is parsed in this page.
Is the YAML Validator free?
Yes, the YAML Validator is free. The first time you validate your first file, you are asked for your name and WhatsApp number once. After that, this and every other Uncodemy tool opens straight away without the form.