DevOps Tools · Guide
YAML Formatter / Validator guide
Validate and re-format YAML with clear parser errors and safe parsing.
Open the YAML Formatter / ValidatorAbout the YAML Formatter / Validator
YAML is the configuration language of Kubernetes, Docker Compose, GitHub Actions, Ansible and OpenAPI. Its reliance on indentation means one misplaced space can change meaning or break a deployment.
This tool validates YAML, reports parser errors with line and column, and re-formats documents with consistent indentation while preserving comments, key order, anchors and value types.
How to use
- Paste YAML into the editor or load the sample.
- Choose 2- or 4-space indentation.
- Click Format (or Validate to check without reformatting).
- Fix any reported errors, then copy the result.
Examples
Normalise indentation
Input
services:
web:
image: nginx
ports:
- "80:80"Output
services:
web:
image: nginx
ports:
- "80:80"Common error: tab indentation
Input
key:
value: 1Output
Tabs are not allowed as indentationParser behavior
- Parses YAML 1.2 using the core schema with the open-source
yamllibrary. yes/no/on/offare strings in YAML 1.2 (they were booleans in YAML 1.1). Quote values when in doubt.- Multi-document streams separated by
---are supported. - Duplicate keys are reported as errors.
- Safe parsing: custom tags such as
!!python/objectare never constructed — unknown tags produce a warning and the value is treated as plain data. Alias expansion is limited to prevent “billion laughs” attacks.
Frequently asked questions
Does formatting change my data?
No. The document is round-tripped through its syntax tree, so values, types, comments and key order are preserved; only indentation and spacing are normalised. Long strings are not re-wrapped.
Why does my file fail with a tab error?
YAML forbids tab characters for indentation. Replace tabs with spaces.
Can I convert YAML to JSON?
Use the JSON/YAML Tree Visualizer to inspect structure, or paste data into the JSON Formatter once converted.
Ready to try it? Everything runs locally in your browser.
Open the tool