A formatter, or code formatter, is a tool that automatically rewrites the presentation of source code, such as indentation, line breaks, spacing and quotation marks, to match a fixed set of rules without changing how the code behaves. Well-known examples include Prettier for JavaScript, Black for Python and gofmt for Go.
Unlike a linter, which finds errors and risky patterns, a formatter focuses on making code look consistent. It is used to keep a uniform style in code edited by many people or by AI coding tools.