YAML Formatter

Format and validate YAML with consistent indentation and optional key sorting.

Input data is processed in your browser
Data is never sent to a server

Tool

0 chars

or drag & drop a file

What is YAML Formatter?

YAML Formatter reformats YAML into a clean, consistently indented structure. It can also sort keys alphabetically and validates syntax at the same time. Useful for tidying up Docker Compose, GitHub Actions, Kubernetes, and other configuration files.

How to Use

  1. Paste YAML text into the input field.
  2. Click "Format" to pretty-print with consistent indentation.
  3. Set the indent width (2 or 4 spaces) and optionally sort keys alphabetically.
  4. Click "Copy Result" to copy to clipboard.

FAQ

Can it detect YAML syntax errors?

Yes. If you enter invalid YAML, a parse error message is displayed.

Are comments preserved?

No. Comments are removed during the parse and re-dump process.

How are anchors and aliases handled?

Anchors and aliases are expanded and inlined in the output.

Is my data sent to a server?

No. All processing happens in your browser.