Docker Compose Formatter
Beautify or minify docker-compose YAML files with validation. Supports any valid YAML.
Input YAML
Output
Formatted YAML will appear here
Docker Compose YAML Formatter
Paste your docker-compose.yml and get consistently indented, clean YAML output. The tool validates your YAML before formatting, reports syntax errors, and offers a minify mode. All processing happens locally — your compose files never leave your browser.
Frequently Asked Questions
- Does this only work with docker-compose.yml files?
- The formatter works with any valid YAML document. It is optimized for docker-compose files but will correctly format any YAML you paste.
- Does it preserve comments?
- YAML comments are parsed but not preserved by the underlying YAML parser — this is a limitation of how YAML libraries parse documents. The formatter outputs clean, re-indented YAML without original comments.
- What does minify do?
- Minify outputs the YAML in a compact flow-style format, reducing whitespace. Useful for embedding YAML in scripts or environment variables.
- Is my docker-compose file sent to a server?
- No. Formatting and validation run entirely in your browser using js-yaml. Your file contents never leave your device.