Bad indentation
YAML is indentation-sensitive. Even one misplaced space can break the whole document.
items:
- apple
- banana
items:
- apple
- banana
Validate YAML online, detect syntax errors, check indentation, review warnings, and fix common YAML and Ansible issues faster.
1
1
Note: a regular textarea cannot highlight parts of text inside the field. That is why this editor marks line numbers and jumps to the error location.
This online YAML validator is designed for plain YAML files and Ansible playbooks. It helps identify the kinds of problems that commonly break parsing, deployment, and automation workflows.
YAML is indentation-sensitive. Even one misplaced space can break the whole document.
items:
- apple
- banana
items:
- apple
- banana
A mapping key usually needs a colon before the value.
name John
age: 30
name: John
age: 30
YAML should use spaces for indentation. Tabs often cause parser errors.
tasks:
- debug:
msg: hello
tasks:
- debug:
msg: hello
Using the same key twice in one mapping can hide values and break automation.
service:
enabled: true
enabled: false
service:
enabled: false
An alias must reference an anchor that already exists.
defaults: *base
defaults: &base
retries: 3
copy: *base
Quoted booleans, nulls, or numbers become strings instead of native YAML values.
enabled: "true"
port: "8080"
enabled: true
port: 8080
Ansible playbooks often fail because YAML structure looks valid at first glance but does not match what the tool expects. This validator helps catch both syntax errors and common playbook mistakes earlier.
The most common YAML errors are bad indentation, missing colons, duplicate keys, broken lists, and anchors or aliases used incorrectly.
Use spaces consistently, keep items on the same level aligned, and avoid tabs in indentation.
Yes. The validator can check standard YAML syntax and many common problems seen in Ansible playbooks.
Different tools may apply different YAML versions or extra rules. Duplicate keys, merge keys, and implicit types are common sources of differences.
This tool can automatically fix some simple issues, but structural problems may still need manual review.
No. In most cases quoted values such as "true" or "false" become strings, not booleans.