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.
Worked example
octopus: arms: 8 is a mapping inside another mapping. Replacing indentation with tabs can make it invalid.
Before you rely on 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.
Help with the result
Cite this page
ToolOctopus. “YAML formatter.” Updated . https://tooloctopus.com/yaml-formatter.
Add an access date if your instructions require one.
Citation formatting uses citeproc-js by Frank Bennett and Citation Style Language styles. License and source code.