YAML Validator
Check YAML syntax and locate parsing errors.
Your result will appear here…
How to use YAML Validator
- Paste one YAML document.
- Select Validate.
- Fix the first reported error and validate again.
Example
Input / settings:
server: port: 3000 enabled: true
Output:
Valid YAML ✓
Validation only reports whether the text parses; it does not print the parsed values.
When to use
- Check a configuration or CI file before you commit it.
- Find an indentation or quoting mistake that stops a file from parsing.
- Confirm that no mapping repeats a key.
Overview
YAML Validator parses your text as a single YAML document with the yaml library, using YAML 1.2 rules, and reports Valid YAML ✓ or the parser's errors with line and column. The check covers syntax and nothing else: it does not know your application's schema and does not show how values are typed, so a valid document can still mean something other than you intended.
Supported input
YAML text
Output details
validation result
Limitations
- Accepts a single YAML document. A second document after a --- separator is reported as an error.
- Checks YAML syntax only. It does not apply a schema and does not show how values are typed.
Common mistakes
- Repeated keys are errors. Two a: entries in one mapping fail with Map keys must be unique and the line and column of the second one. The YAML specification defines a mapping as an association of unique keys.
- Tabs cannot indent. A line indented with a tab is rejected, and the YAML 1.2 specification says tab characters must not be used in indentation.
- Only one document is accepted. A second document after a --- line is an error, even though YAML itself allows a stream of several documents.
- Valid does not mean typed as intended. version: 1.10 is read as the number 1.1 and 08 as the number 8. yes, no, on and off are plain strings here, while YAML 1.1 parsers read them as booleans, so another tool may disagree.
Practical tips
- Quote values that must stay text, such as '1.10' or 'yes'. A quoted value is always a string.
- Use YAML to JSON to see exactly which types the parser reads from your document.
Privacy and security
This tool runs entirely in your browser. Your input is never uploaded to our servers. Validation runs locally and only parses the text; nothing described by the document is executed or fetched. It checks syntax only, so a valid file can still hold values that your application rejects, and it is not a substitute for schema validation.
References
- YAML Ain’t Markup Language (YAML) 1.2.2 specification
- YAML 1.1 type: Boolean
- yaml library documentation
Frequently asked questions
Does the validator accept a file with several documents?
No. A second document after a --- separator is reported as an error. Validate each document on its own.
Is a file that contains only comments valid YAML?
Yes. A document with comments and no content parses without an error.
Are anchors and aliases accepted?
Yes. A document such as a: &x 1 followed by b: *x is reported as valid.