YAML error: "mapping values are not allowed here" or tabs and indentation problems

Last reviewed 2026-09-19

YAML uses indentation to show structure, so a tab, a mix of two and four spaces or a stray space changes the meaning or breaks parsing. Configuration files for Docker, CI systems and Kubernetes fail this way constantly.

Messages you might see

  • “mapping values are not allowed here”
  • “found character '\t' that cannot start any token”
  • “did not find expected key / bad indentation of a mapping entry”

Why it happens

  • A tab character used for indentation (YAML only allows spaces).
  • Inconsistent indentation widths in nested blocks.
  • A colon inside a value that needs quotes, or trailing whitespace.

Try this first (free, no tool needed)

  1. Turn on "show whitespace" in your editor to spot tabs and odd spacing.
  2. Check the line named in the error and the line above it for a value containing a colon that should be quoted.
  3. Validate with your editor's YAML mode or the tool you are configuring (docker compose config, kubectl --dry-run).

If that didn't work

These tools run in your browser. Your file is read and repaired on your own device and is never uploaded.

Broken YAML Indentation Fixer

Converts tab indentation, re-indents nested blocks to a consistent width (2 or 4 spaces), trims trailing whitespace, normalises line endings and flags duplicate top-level keys, preserving block scalars exactly. It repairs layout only: it does not validate that the content means what your tool expects.

Open Broken YAML Indentation Fixer

Common questions

Will it fix a wrong value?

No. It repairs layout, not meaning. Wrong keys or values still need you or your tool's own validator.

Is my file uploaded anywhere?

No. The tool runs as a program inside your own browser, so the file is read and repaired on your device and never sent to a server.

Related guides