General dev

YAML Formatter

Runs locally

Use YAML Formatter

What it does

Normalise irregular indentation in a YAML file to two or four spaces per level, for example after combining snippets from different sources.

It runs entirely in your browser: nothing you enter is uploaded.

Example

Four-space config

Input
server:
    host: 127.0.0.1
    port:    8080
    tls:
        enabled: true
Output (captured 2026-10-20)
server:
  host: 127.0.0.1
  port: 8080
  tls:
    enabled: true

Every level is re-indented to two spaces, and port: 8080 becomes port: 8080.

FAQ

Does it validate YAML?

No. It works line by line without parsing, so unclosed brackets, bad quoting or duplicate keys are not reported; the only warning is for a list item with nothing after the dash. Check the result with a YAML parser before relying on it.

How is the new indentation worked out?

The smallest indentation on the earlier lines counts as one level, and each line's depth is its indentation divided by that step, rounded. Comment lines keep their original indentation, runs of spaces after a colon are collapsed even inside quoted values, and block strings (| or >) can shift, so compare before and after.

Is the YAML sent anywhere?

No. Formatting runs in your browser, and nothing is uploaded.