The best code formatters, according to hackers
7 code formatters were recommended on Hacker News between November 2025 and November 2026. We rank them by how many separate people recommend each one, and 2 earn the Hacker Approved badge.
Top picks
The two most recommended code formatters with the badge. Each figure is 2 people. RecommendsCriticizes One comment
Widely loved by Go developers
Go's built-in formatter that ends style debates by enforcing one standard format with almost no settings. Critics say it does not break long lines and is not strict enough.
Consistent style ends review debates
Opinionated Python formatter that ends style debates with one consistent, stable layout. Common caveat: it sometimes collapses lines against intended formatting, hurting readability.
All 7 code formatters, ranked
Select a column heading to sort. Approval share is recommenders out of everyone who gave an opinion; the tick on each bar marks the 2 to 1 line the badge needs. Months counts the months, out of 13, in which someone recommended it.
| Rank | |||||||
|---|---|---|---|---|---|---|---|
| 1 | gofmt | 26 | 5 | 84% | 10 | — | Approved |
| Tied 2 | Black | 18 | 6 | 75% | 6 | — | Approved |
| Tied 2 | FracturedJson | 18 | 2 | 90% | 2 | — | — |
| 4 | Prettier | 16 | 10 | 62% | 8 | — | — |
| 5 | Oxfmt | 14 | 9 | 61% | 6 | — | — |
| 6 | clang-format | 7 | 1 | 88% | 4 | — | — |
| 7 | rustfmt | 6 | 4 | 60% | 5 | — | — |
How we rank
Rank is the number of separate people who recommend a product in a Hacker News comment over the past year. Someone who praises the same code formatter in five threads counts once.
The badge goes to code formatters that at least 10 people recommend, with recommenders outnumbering critics at least 2 to 1, recommended in at least 4 of the 13 months.
Rankings are never for sale. We may earn a commission when you buy through our links. It never changes the order.