YAML Formatter

Format and beautify YAML with consistent indentation (2 or 4 spaces).

Paste YAML content and get it back with consistent indentation, normalized spacing around colons, and clean structure. Choose between 2-space and 4-space indentation. The formatter parses the YAML and re-serializes it, so output is always structurally valid.

Indentation:
yaml input
0 chars1 lines
formatted yamlREADY
0 chars1 lines

Related Tools

FAQ

Are comments preserved after formatting?
Comments are not preserved because the formatter parses the YAML into a data structure and re-serializes it. Use the YAML minifier if you need to strip comments intentionally.
What indentation options are available?
2-space indentation (common for Kubernetes manifests and most YAML tooling) and 4-space indentation (preferred in some Python projects) are both supported.
What YAML features are supported?
Scalars, strings, numbers, booleans, null, sequences (arrays), and mappings (objects) are all handled. Multi-document YAML (---) and complex anchors/aliases may not be fully supported.