WSWhat Scene?

Learn · Developer tools

What is a code formatter?

A code formatter rewrites your code into one consistent layout: indentation, line breaks, quote style, spacing. It does not judge whether the code is correct, only where things go on the page. Prettier, gofmt and Black are the common ones, and they run on save.

The point is not that its layout is better than yours. It is that the layout stops being a decision. Once a formatter runs on every save, nobody adjusts spacing by hand and no pull request contains a change that happened because two editors wrapped a line differently.

A formatter reads the whole file and prints it back out, so it cannot contradict itself. That is the structural difference from a linter, which evaluates rules one at a time and can hold two that disagree. It is also why formatters have very few options: each one added is a decision every team using it then has to make.

Updated August 2026

Want this built, not just explained?