Hacker ApprovedDepartments

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

  1. gofmt

    26 recommend, 5 criticize, 84% approval

    Ranked 1 of 7 by recommenders

    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.

  2. Black

    18 recommend, 6 criticize, 75% approval

    Shares rank 2 of 7 by recommenders

    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.

Code formatters ranked by the number of people who recommend them
Rank
1gofmt26584%10—Approved
Tied 2Black18675%6—Approved
Tied 2FracturedJson18290%2——
4Prettier161062%8——
5Oxfmt14961%6——
6clang-format7188%4——
7rustfmt6460%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.