Skip to content
ToolMug

YAML Formatter

Clean up YAML with consistent two-space indentation and spacing, and find syntax errors before they break a deployment. Comments and key order are kept.

Runs in your browser — nothing you enter is uploaded

How to use

  1. Paste your YAML, or click Load sample.
  2. Choose the indentation.
  3. Click Format, or press Ctrl+Enter (⌘+Enter on Mac).
  4. Copy the formatted YAML.

Options explained

Indent
Indentation for nested mappings. Two spaces is the usual style for Kubernetes, Compose and GitHub Actions files.

Examples

Mixed indentation. A Compose file with four-space and two-space sections is re-indented consistently.

Validate before committing. Paste a GitHub Actions workflow to catch a stray tab or missing colon.

Frequently asked questions

Are comments kept?

Yes. Comments, key order, anchors and multi-document separators (---) are preserved.

Why does it report an error on a line that looks fine?

YAML errors often come from indentation on an earlier line, or from a tab character — YAML does not allow tabs for indentation. Check the lines just above the reported position.

Is my file uploaded?

No. Formatting runs in your browser, so configuration with hostnames or keys stays on your device.

Privacy

This tool runs entirely in your browser. Your files and text are processed on your device and are never uploaded to our servers.

Related tools