YAML Formatter & Validator
Paste YAML to check that it is valid and to re-indent it neatly with 2 or 4 spaces. Comments are kept, you can sort the keys, and files with several documents separated by --- are supported. Errors come with the line and column, and duplicate keys are caught. Useful for Docker Compose, Kubernetes, GitHub Actions and other configuration files. It runs in your browser, so nothing is uploaded.
How to use it
- Paste your YAML, or press Sample.
- Choose the indent, and whether to sort the keys.
- Press Format, or Check only to validate without changing anything.
- Copy the result or download it as a .yaml file.
Frequently asked questions
Is what I paste uploaded anywhere?
No. This tool runs in your browser, on your own device, and what you paste is never sent to our server.
Does it keep my comments?
Yes. Comments stay with the lines they belong to. Spacing is normalised, so a comment after a value may move to sit one space after it.
Why is my YAML invalid?
Common causes are tabs used for indentation (YAML allows only spaces), a list item or key at the wrong indentation, a missing space after a colon or dash, or an unclosed bracket or quote. The message shows the line and column.
What happens with duplicate keys?
They are reported as an error. Many tools silently keep the last value, which hides mistakes.
Can I convert YAML to JSON?
Yes, with the JSON, YAML and CSV converter. This tool only formats and checks YAML.
Related tools
JSON, YAML & CSV Converter
Convert JSON to YAML, YAML to JSON, JSON to CSV and CSV to JSON, with nested data, delimiters and type detection handled.
JSON Formatter & Validator
Format, validate and minify JSON in your browser. Shows the exact line and column of any error.
XML Formatter & Validator
Beautify, minify and check XML: see whether it is well-formed, with the line and column of the first error.
.env File Validator & Cleaner
Check a .env file for mistakes such as duplicates, unclosed quotes and exposed secrets, and compare it with .env.example.
These tools run entirely in your browser and are provided free, without warranty. Check important results before using them in production.