YAML Formatter
The YAML formatting tool helps you format, minify, and validate YAML data, making it easier to read and debug.
All tools on this site run entirely in your browser locally. No data is uploaded to any server.
Features:
- Format YAML: Auto-unify indentation (2 spaces), fix hierarchy alignment, support folding/expanding nodes
- Keep comments: When checked, preserves original comments (including trailing comments); state is remembered; compact mode does not keep comments
- Compact mode: Converts objects/arrays to flow-style inline representation, smaller size for comparison
- Syntax validate: Real-time syntax error hints after input, helps locate indentation or colon issues
- YAML validate: Click the validate button to check for issues such as syntax errors, tab indentation, duplicate keys, boolean spelling errors (e.g., "tru"/"flase"), trailing whitespace, improper indentation, excessively long lines, comment formatting, and trailing blank lines.
- Local files: Support dragging or selecting local YAML/YML files
- Real-time processing: Auto-beautify on input, or manually click the format button to re-layout
- Export results: One-click copy, save as file, with search, line jump and fullscreen view
Common uses:
- Format and beautify YAML config files (e.g., Docker Compose, Kubernetes, Spring Boot)
- Troubleshoot YAML indentation or syntax issues, quickly locate error positions
- Compare config differences across versions; compact mode is ideal for diff
- Organize Ansible Playbook, GitHub Actions and other YAML script files
- Convert JSON results to YAML for use in configuration management tools