ShadTools

YAML Formatter

Format YAML mappings, sequences, flow collections, comments, anchors, and scalar values with consistent indentation.

YAML input
Formatted YAML

Normalize YAML configuration

The formatter parses YAML as a document so comments and YAML-specific syntax can survive formatting. It also reports invalid indentation, duplicate keys, and malformed collections.

Frequently Asked Questions

Are YAML comments preserved?+

Yes. The document-based formatter retains comments while normalizing layout and indentation.

Does the formatter support anchors and aliases?+

Yes. Standard YAML anchors, aliases, block scalars, mappings, and sequences are supported.

Why are duplicate keys rejected?+

Duplicate mapping keys are ambiguous and can be interpreted differently by applications, so strict validation reports them as errors.

Related Tools