← Back to all tools

YAML Formatter & Beautifier

Format, beautify, minify, and sort YAML with proper indentation. Perfect for Kubernetes manifests, Docker Compose, GitHub Actions, and config files.

YAML Syntax Reference

ConstructSyntaxDescription
Mappingkey: valueKey-value pair (colon + space)
Sequence- itemList item (dash + space)
Nested key: valueIndentation creates hierarchy
Stringname: helloUnquoted, single, or double quotes
Multiline (literal)text: |Preserves newlines exactly
Multiline (folded)text: >Folds newlines into spaces
Comment# commentComments start with #
Document start---Marks beginning of a document
Nullvalue: nullOr ~ or empty value
Booleanflag: truetrue/false, yes/no, on/off
Anchor&name valueDefine reusable value
Alias*nameReference an anchor

Frequently Asked Questions

What is YAML used for?

YAML is a human-readable data serialization format widely used for configuration files. Common uses include Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Ansible playbooks, and application config files.

Does 'Sort Keys' sort nested keys too?

Currently, Sort Keys sorts top-level keys alphabetically while preserving nested structure. This is useful for standardizing configuration file order (e.g., alphabetical sections in a docker-compose.yml).

What does 'Minify' remove?

Minify removes blank lines, comments, and trailing whitespace while preserving the essential YAML structure. It reduces file size while keeping the document valid and parseable.

Should I use 2 spaces or 4 spaces for YAML?

2 spaces is the most common convention, especially in Kubernetes, Docker Compose, and GitHub Actions. 4 spaces provides more visual separation for deeply nested structures. Tabs are valid but rarely used in YAML.

Is this tool safe for production YAML files?

Yes — all processing happens in your browser. No data is sent to any server. However, always review formatted output before replacing production configs, especially for files with anchors, aliases, or complex multiline strings.