YAML Validator
Check YAML for syntax errors with line and column numbers, find duplicate keys and bad indentation, and tidy the formatting.
Reviewed 23 November 2026 · Free · No account needed
How to use
- Paste your YAML into the box, or press Example.
- Read the status and the list of problems. Press a line number to jump to that place in the text.
- Fix the first error first, because later ones are often caused by it.
- Press Format to re-indent valid YAML, with an option to sort keys, then copy the result.
Example
Input: a: 1 b: 2 a: 3
Output: Error on line 3, column 1: Map keys must be unique
How it works
The text is parsed with the open-source yaml library using YAML 1.2 rules. Each document in the stream gets its list of errors and warnings with positions. If it parses, the references to anchors are resolved to make sure none point at something that does not exist.
There is no formula. The check is a parse of the text against the YAML grammar.
Limits and edge cases
- This checks syntax only. It does not know what your file is for, so it cannot tell whether a Kubernetes, Docker Compose or CI file has the right fields.
- YAML 1.2 rules are used, so words such as yes, no and on are plain text, not booleans. Some older tools read them differently.
- Formatting keeps comments and anchors but rewrites spacing, and may change quoting where YAML allows more than one style.
- Up to 2 million characters. Files with several documents separated by --- are checked document by document.
- Tab characters cannot be used for indentation. Use spaces.
- An unquoted value that contains a colon followed by a space, such as key: value: bad, is read as a nested mapping and fails. Put the value in quotes.
- A flow list that is not closed, such as [1, 2, reports an error on the line after it, because that is where the parser notices.
- An alias such as *name with no matching anchor &name is an error even though the text is otherwise well formed.
Privacy
Your YAML is parsed in this browser tab. It is never uploaded or stored, so configuration with internal names stays on your device.
About this page
Written and reviewed by Toolnexo on 23 November 2026. The limits above describe the published tool, not an idealised version of it. If a result looks wrong or the page is unclear, email [email protected] with the tool URL and what you entered. Corrections are published here.
Guides that use YAML Validator
Related tools
Questions about YAML Validator
How do I find the error line in YAML?
Paste the YAML and read the list of problems. Each one shows the line and column, with the line of text and a caret under the column. Press the line number to move the cursor there.
Why does YAML not allow tabs?
The YAML specification forbids tabs for indentation because their width is not fixed, so the same file could mean different things in different editors. Replace tabs with spaces.
Does it check Kubernetes or Docker Compose files?
It checks that the file is valid YAML, which catches indentation and syntax mistakes. It does not check against a schema, so a misspelled field name will not be reported.
What does Format do to my YAML?
It rewrites valid YAML with consistent indentation of 2 or 4 spaces and, if you choose, sorted keys. Comments, anchors and document markers are kept. If the YAML has errors, fix them first.
Is my YAML uploaded?
No. The check runs in your browser tab, so configuration files with internal hostnames or settings are not sent anywhere.