YAML Pretty Print
Paste messy or compact YAML and get a cleanly indented, normalized document ready to copy or commit.
Last updated: May 28, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is YAML Pretty Print?
YAML Pretty Print parses your YAML and re-serializes it with consistent indentation, normalized whitespace, and optionally sorted keys. It is useful for normalizing YAML generated by scripts, fixing inconsistent indentation from copy-paste, or preparing YAML for version-controlled config files.
How to Use YAML Pretty Print
Paste your YAML into the input panel.
Choose indent size (2 or 4 spaces).
Toggle key sorting if you want alphabetical ordering.
Adjust line width if needed.
Copy the formatted output.
Common Use Cases
- Normalizing YAML generated by a script before committing.
- Fixing inconsistent indentation in a Kubernetes manifest.
- Sorting keys in a YAML config for cleaner diffs.
- Formatting compact single-line YAML for readability.
Example Input and Output
Compact YAML is reformatted with clean indentation.
name: Alice
address: {city: London,zip: EC1A}
tags: [admin,editor]name: Alice
address:
city: London
zip: EC1A
tags:
- admin
- editorTip
Enable key sorting before committing YAML config files to version control — it produces stable, predictable diffs.

