← All tools

YAML formatter

Format YAML, keep comments, and see a JSON conversion.

Your input stays in this browser.

Your result

Indentation is part of YAML

The YAML parser reports the line and column of invalid input. Formatting keeps comments. Convert to JSON reads the values, so comments and YAML-specific presentation are not part of that output. Inspect or minify the converted JSON in the JSON formatter.

A worked example

octopus: arms: 8 is a mapping inside another mapping. Replacing indentation with tabs can make it invalid.

Before you use the result

One document at a time is supported. Custom tags are not interpreted, and unsafe integers are rejected for JSON conversion rather than rounded. Cyclic aliases cannot become ordinary JSON.

Formatting rules and what is preserved