Prettify YAML
Format and beautify YAML files with clean 2-space or 4-space indentation. Normalizes nested structures, sequences, and mappings with optional alphabetical key sorting.
Interactive workspace loading...
How to Use Prettify YAML
Key Features
Common Use Cases
- Cleaning up messy Helm charts, Docker Compose, or Ansible playbooks.
- Standardizing indentation before committing YAML configuration files into version control.
- Diffing two versions of a configuration file with sorted keys.
- Formatting Swagger and OpenAPI API definitions for documentation.
Frequently Asked Questions
2 spaces per indentation level is the universal industry standard for YAML documents, widely adopted by Kubernetes, Docker, Ansible, and GitHub Actions.
Key sorting is optional! You can toggle 'Sort object keys alphabetically' on or off according to your preference.
Prettifying parses the structural data model; therefore, standalone comments may be stripped in the normalized output. Use the Validate YAML tool if you wish to inspect syntax while preserving original comments.