YAML formatter/validator · Guide

YAML Indentation Explained

Indentation is the heart of YAML. Getting it right is most of getting YAML right.

Spaces define nesting

Each level of nesting is one consistent indentation step deeper, using spaces only. The amount must be consistent within a block, which is why a single misaligned line breaks structure.

No tabs allowed

YAML forbids tabs for indentation. An editor that inserts tabs is a frequent source of errors; configure it to use spaces for YAML files.

Frequently asked questions

Can I use this for production work?

Yes, for inspection, formatting and quick generation. Still review the output before committing it to production code or configuration.

Ready to try it?

Open the free browser-based YAML formatter/validator and apply what you just read — no sign-up, runs locally.

Open the YAML formatter/validator tool