YAML Linter & Formatter
Used 5,200 times
Paste any YAML and hit Lint & Format. Syntax errors are listed with their line numbers. If the input is valid, a cleanly re-indented copy is shown below.
Latest YAML articles
JSON to YAML for Ansible Playbooks – Migrate Config Without Rewriting
Learn how to convert JSON task definitions and variable files to Ansible YAML playbooks. Covers boolean handling, nested vars blocks, and the Ansible-specific YAML patterns.
JSON to YAML Converter Online – Transform Data Easily
Learn how to convert JSON to YAML and YAML to JSON instantly in your browser — with side-by-side examples, common conversion pitfalls, and when to use each format.
JSON to YAML for Kubernetes – Convert kubectl Output to Manifests
Learn how to convert kubectl JSON output to YAML manifests for version control. Covers field cleanup, multi-resource files, and Helm values file patterns.
What is a YAML Linter?
A YAML linter parses your YAML and reports structural errors — tabs used instead of spaces, missing colons, inconsistent indentation — before they cause runtime failures. This tool also reformats valid YAML to 2-space indentation, so configs stay consistent across teams and CI pipelines.
How to Use
- Paste your YAML into the input box.
- Click Lint & Format.
- If errors exist, each is listed with a line number badge — fix them and re-lint.
- If the YAML is valid, the formatted output appears below. Copy it with one click.
Common YAML Errors
- Tabs instead of spaces — YAML forbids tab characters for indentation. Replace all tabs with spaces.
- Missing space after colon —
key:valueis invalid; it must bekey: value. - Inconsistent indentation — Mixing 2-space and 4-space indentation within the same file causes parse errors.
- Unquoted special characters — Values containing
:,#, or{}must be quoted.
FAQs
Does formatting change my data?
No. Only whitespace and colon spacing are normalized. Keys, values, and structure are preserved exactly.
Does it support multi-line block scalars?
Yes. Block scalar content (lines after | or >) is preserved as-is and not re-indented.
Can I use this for Kubernetes or GitHub Actions YAML?
Yes. Any valid YAML file — Helm charts, GitHub Actions workflows, Docker Compose, Ansible playbooks — can be linted and formatted here.