YAML Formatter
Format and normalise YAML files with consistent indentation using Prettier.
About the YAML Formatter
Inconsistent indentation is the most common cause of broken YAML. The YAML Formatter normalises indentation and spacing with Prettier so configuration files stay readable and valid.
Everything runs in your browser, so your input is never uploaded to a server.
How to use the YAML Formatter
- Paste YAML or open a .yml/.yaml file.
- Review the formatted output.
- Copy or download it.
Frequently asked questions
Are comments preserved?
Yes. Comments stay attached to the lines they describe.
Can it convert YAML to JSON?
Use the YAML to JSON converter for that; this tool keeps the format as YAML.
Related tools
JSON Formatter
Format and beautify JSON with configurable indentation and optional key sorting. Errors are reported with exact line and column.
HTML Formatter
Beautify messy or minified HTML into clean, indented markup using Prettier, right in your browser.
CSS Formatter
Format CSS, SCSS and Less stylesheets into readable, consistently indented code.
JavaScript Formatter
Beautify JavaScript and JSX with Prettier. Choose indentation, quotes and semicolons.
TypeScript Formatter
Format TypeScript and TSX code with Prettier, including types, generics and decorators.
PHP Formatter
Beautify PHP code following PSR-style formatting with the Prettier PHP plugin.