YAML Sequence Indentation Error – Fix List Indentation

Local only

YAML sequence dash markers belong to a specific indentation level. A list item shifted left or right can leave the sequence or attach it to the wrong parent.

56 chars · 5 lines

Waiting for input

Loading YAML parser…

YAML sequence troubleshooting

How to fix YAML list and sequence indentation

The sample starts a ports sequence correctly, then places the second dash one space too far left. Sequence markers at the same list level must align so the parser can tell which items share a parent. This tool is free to use. No account or payment is required.

Last updated

What you can do here

  • YAML 1.2 parser validation
  • Duplicate mapping key detection
  • Preloaded broken YAML example
  • Readable parser feedback
  • .yaml and .yml file import
  • Browser-local processing

Steps

  1. Find the parent key that owns the sequence.
  2. Align sibling dash markers at one indentation level beneath that parent.
  3. Indent mapping content beneath each list item consistently and validate again.

A dash marker is part of YAML structure

The dash is not decorative bullet text. Its indentation determines the sequence level, while any mapping nested inside that item needs additional indentation relative to the dash.

Nested lists need two levels to stay visually clear

When a mapping contains another sequence, keep the parent mapping key, sequence markers, and nested mapping content visibly separated. Consistent two-space indentation is a common convention even though the parser cares about structure rather than one universal width.

Misaligned YAML sequence item

The second port dash must align with the first port dash.

Invalid YAML

services:
  - name: api
    ports:
      - 80
     - 443

Corrected YAML

services:
  - name: api
    ports:
      - 80
      - 443

Common questions

Frequently asked questions

Do all YAML list dashes need the same indentation?

Sibling items in the same sequence should use the same indentation level. Nested sequences use a deeper level under their parent.

Can a YAML list contain mappings?

Yes. A sequence item can contain a mapping, but the mapping fields must be indented consistently beneath that item.

Why does moving one dash change the YAML structure?

Indentation determines parent-child relationships in block YAML, so moving a dash can place the item in another sequence or outside the intended block.

Debugging a specific YAML issue? Browse YAML troubleshooting.