Pages / #hacker-news / #ranking
Hacker News ranking
Hacker News ranks its front page by dividing a story's points by a power of its age, so new stories rise fast and every story sinks as hours pass.
Race to the front pageInteractive
- Gravity
- 1.8
- Added to age
- 2 hours (120 minutes)
- Points exponent (2010 code)
- 0.8
- Post with no URL (2010 code)
- ×0.4
- Karma
- Does not raise rank
- Code posted
- October 2010, by Paul Graham
The formula and a day of decay
In words
The gravity formula
5/5
The HN FAQ says the basic algorithm divides points by a power of the time since a story was submitted 1. In 2010 Paul Graham posted the code then running: points minus one, raised to 0.8, divided by the age in hours plus two, raised to a gravity of 1.8 234. The often quoted (P−1)/(T+2)^1.8 is the version he called close to the current one, but a little out of date 5. Compare Reddit hot ranking, which adds time instead of dividing by it.
5 of 5 quotes found in their sources
-
Hacker News FAQ news.ycombinator.com
The basic algorithm divides points by a power of the time since a story was submitted.
Quote found in the source -
Paul Graham's comment with the ranking code (Hacker News, October 2010) news.ycombinator.com
gravity* 1.8 timebase* 120
Quote found in the source -
Paul Graham's comment with the ranking code (Hacker News, October 2010) news.ycombinator.com
(if (> base 0) (expt base .8) base)
Quote found in the source -
Paul Graham's comment with the ranking code (Hacker News, October 2010) news.ycombinator.com
(expt (/ (+ (item-age s) timebase*) 60) gravity)
Quote found in the source -
Paul Graham's comment with the ranking code (Hacker News, October 2010) news.ycombinator.com
That's close to the current version, but a little out of date.
Quote found in the source
Penalties and flags
5/5
Votes and age are not the whole story. The FAQ lists user flags, anti-abuse software, software that demotes overheated discussions, account or site weighting, and moderator action 1, and says you can't derive rank from votes and time alone 2. In the 2010 code a post with no URL was multiplied by 0.4 3, and a controversy factor was there, in Graham's words, to recognize flamewars 4. Karma does not help: posts by high-karma users do not rank higher 5.
5 of 5 quotes found in their sources
-
Hacker News FAQ news.ycombinator.com
Other factors affecting rank include user flags, anti-abuse software, software which demotes overheated discussions, account or site weighting, and moderator action.
Quote found in the source -
Hacker News FAQ news.ycombinator.com
You can't derive rank from votes and time alone.
Quote found in the source -
Paul Graham's comment with the ranking code (Hacker News, October 2010) news.ycombinator.com
(blank s!url) nourl-factor*
Quote found in the source -
Paul Graham's comment with the ranking code (Hacker News, October 2010) news.ycombinator.com
Its purpose is to recognize flamewars.
Quote found in the source -
Hacker News FAQ news.ycombinator.com
Do posts by users with more karma rank higher? No.
Quote found in the source
Show HN
5/5
Show HN is for something you've made that other people can play with; blog posts, sign-up pages and newsletters are off topic 12. Every Show HN appears on the shownew list, and once it clears a small points threshold it also appears on the show page in the top bar 3. Asking friends to upvote is not ok 4, and HN penalizes or bans submissions, accounts and sites that do it 5.
5 of 5 quotes found in their sources
-
Show HN Guidelines (Hacker News) news.ycombinator.com
Show HN is for something you've made that other people can play with.
Quote found in the source -
Show HN Guidelines (Hacker News) news.ycombinator.com
Off topic: blog posts, sign-up pages, newsletters, lists, and other reading material.
Quote found in the source -
Show HN Guidelines (Hacker News) news.ycombinator.com
Once it clears a small points threshold, it will appear on the show page in the top bar.
Quote found in the source -
Show HN Guidelines (Hacker News) news.ycombinator.com
Please don't ask friends to upvote or comment.
Quote found in the source -
Hacker News FAQ news.ycombinator.com
We penalize or ban submissions, accounts, and sites that break this rule
Quote found in the source