Developer Tools

YAML Formatter

Paste messy or minified YAML and get back clean, consistently indented, human-readable YAML — free and browser-based.

No uploads — browser onlyInstant result

YAML Input

Normalises Indentation

Parses the YAML structure and re-serialises with consistent 2-space indentation regardless of the original spacing.

Private

All formatting runs in your browser using a built-in parser. No data is sent to any server.

Validates as It Formats

If the YAML is invalid, a helpful error message is shown so you can fix the problem before formatting.

How to format YAML

  1. Paste your YAML into the input area (or use the built-in sample).
  2. Click Format YAML.
  3. Copy the clean, consistently indented output with the Copy button.

Privacy — processed in your browser

YAML formatting runs entirely in your browser — no data is sent to any server. Your configuration files and data stay on your machine.

Frequently Asked Questions

What does "formatting" do to YAML?

The formatter parses your YAML into a data structure and re-serialises it with consistent 2-space indentation, normalised whitespace, and proper quoting. Comments are not preserved (JSON has no comment syntax).

Will comments survive formatting?

No — YAML comments (# ...) are stripped during parsing. If you need to preserve comments, use a language-specific formatter in your editor (e.g. Prettier for YAML).

What YAML is NOT supported?

Anchors & aliases (&anchor, *alias), YAML tags (!!str, !!int), multi-document streams (multiple --- separators), and very complex inline flow notation are not supported. Standard configuration YAML (Kubernetes, Docker Compose, GitHub Actions) is well supported.

Why am I getting an error on valid YAML?

If your YAML uses anchors, tags, or other advanced features this tool doesn't handle, it may report an error. Try the YAML to JSON tool for troubleshooting, or simplify your YAML first.

Does it handle inline flow YAML like {key: val}?

Yes — flow notation is parsed and expanded to block notation in the output. scores: [95, 87] becomes a proper block sequence with - 95 / - 87.

Related tools