YAML Formatter & Validator
Validate and format YAML, keeping comments, anchors and every value as written.
Runs in your browser
Why YAML breaks, and how to check it
YAML runs Kubernetes manifests, Docker Compose files, GitHub Actions and most CI pipelines. Its structure comes from indentation, so one misplaced space or a tab can break a deploy, often with an unclear error far from the cause.
Paste your YAML and it's checked as you type. A problem is shown with its line and column in plain English, like a key that appears twice or a list item whose dash doesn't line up. When it's valid, you get a cleanly indented copy with your comments, anchors (&name), aliases (*name), tags like !Ref and multi-line blocks kept.
How to use the YAML Formatter & Validator
Paste your YAML. Or load the sample, a small Kubernetes Deployment and Service.
Fix any problem shown. The message under the box gives the line and column of the first problem.
Pick the indentation. 2 or 4 spaces, and whether list dashes are indented under their key (
Indent list items) or line up with it.Copy the result. Or send it on: convert it to JSON, or compare it with another version.
Tips
- Tabs aren't allowed for indentation in YAML. If your editor inserts them, switch it to spaces.
- Values are never changed:
0123,1.10,yesand long numbers come out exactly as you wrote them, even where another parser would read them as numbers or booleans. - Several documents separated by
---are kept, as in Kubernetes files with many resources.
Frequently asked questions
Does formatting remove my comments?
No. Comments stay on their lines, including comments after a value. Anchors, aliases, tags and | or > blocks are kept too.
Which YAML version is used?
YAML 1.2, the current version. Duplicate keys are reported as errors, because most tools silently keep only the last one.
Can it check a Kubernetes or GitHub Actions schema?
It checks that the YAML itself is valid, not that a field like replicas belongs where it is. To check the shape, convert it to JSON and use the JSON Schema Validator.
Is my YAML sent anywhere?
No. It's checked and formatted in your browser, so secrets in config files never leave your device.