glossary

Gravity 1.8 and a Two-Hour Head Start: How Does Hacker News Ranking Work?

Taras Shynkarenko
Taras Shynkarenko
•Updated: •7 min read
Gravity 1.8 and a Two-Hour Head Start: How Does Hacker News Ranking Work?Gravity 1.8 and a Two-Hour Head Start: How Does Hacker News Ranking Work?

TL;DR

7 min read

Hacker News scores a front page story as its points minus one, divided by its age in hours plus two, raised to the power 1.8, then multiplies that score by penalty factors. The formula comes from news.arc in the publicly released Arc source, and Y Combinator has never published the version running on the live site. The penalty layer on top of it is described only in moderator comments, never in documentation.

How does Hacker News ranking work?

The short answer to how does Hacker News ranking work is a decay formula: Hacker News divides a story's points by its age raised to a fixed power, so a story slides down the front page unless new upvotes arrive faster than the clock runs. Every number in this post comes from news.arc, the front page source file that Y Combinator shipped with the public Arc language release. Hacker News has never published the ranking code running on the live site today, so read this as the last public snapshot of the mechanism, not a description of production.

What is the published Hacker News ranking formula?

The widely circulated version of the formula scores a story as its points minus one, divided by its age in hours plus two, raised to the power 1.8.

score = (points - 1) / (age in hours + 2) ^ 1.8

That line simplifies frontpage-rank in news.arc. The same file sets gravity* to 1.8, which is the exponent, and timebase* to 120 minutes, which is the two hours added to the age. The source also raises the score term to the power 0.8 once a story clears one point, a step the popular one-liner drops, which flattens the reward for very high scores. Use the simplification for intuition and open news.arc when the exact curve matters.

A stopwatch on a desk represents how quickly a story's score decays with age in the ranking formula.

How fast does a Hacker News story decay?

The exponent 1.8 compounds, so rank falls faster than most submitters expect. Take a story sitting at 100 points, three hours after submission: (100 - 1) / (3 + 2) ^ 1.8 = 99 / 18.12 = 5.46. A newer story with 40 points at one hour scores 39 / 7.22 = 5.40, which puts a story with 60 fewer points within a rounding error of it.

Age(age + 2) ^ 1.8Score at 100 pointsPoints needed to match a 3-hour, 100-point story
1 hour7.2213.7041
3 hours18.125.46100
6 hours42.232.34232
12 hours115.580.86633
24 hours352.400.281,927

The right-hand column decides launch strategy. Matching a three-hour-old story at 100 points takes 633 points at twelve hours and 1,927 points at twenty-four. Submit when the audience you want is awake, because no amount of later voting recovers the head start, the same arithmetic that makes the best time to post on Reddit a scheduling question, not a content question.

Why does the formula subtract a point and add two hours?

The two constants exist to stop the curve from breaking at its edges. Subtracting one point discards the submitter's own upvote, so a story nobody else voted for scores zero and never reaches the front page on its author's enthusiasm. Adding two hours to the age keeps a brand new story from dividing by something close to zero: at zero minutes old, the denominator is 2 ^ 1.8 = 3.48 instead of an arbitrarily large multiplier, so two early votes cannot outrank an established story.

What penalties does Hacker News apply to a story?

Penalties multiply the decay score down, and the released source carries four of them. news.arc sets nourl-factor* to 0.4 for a text post with no link, lightweight-factor* to 0.3 for posts the file classes as lightweight, including image posts and posts from a domain list held in lightweights*, and a flat 0.5 for item types other than stories and polls. A fourth, contro-factor, kicks in once a story passes 20 comments and its comment count exceeds its points, multiplying the score by the square of points over comments.

Beyond that file, moderators have described further penalties in Hacker News comment threads: a flamewar detector that demotes threads where argument outruns votes, per-domain downweighting, and manual moderator intervention on stories judged off-topic. That layer has never appeared in documentation or in released code, and Y Combinator publishes no list of penalties or their sizes. Anyone quoting a specific penalty coefficient for the live site is quoting a moderator comment or an inference from observed rank, not a published spec.

The released code also gives readers a lever. A user above a karma threshold can flag a story, and once flags pass a kill threshold on a story under 10 points with no admin upvote, the code marks it dead and removes it from the front page. Coordinated voting is handled separately through a sockvotes field that realscore subtracts before ranking, which is the source file's answer to astroturfing.

Penalty factors in news.arc
No URL0.4x for a text post with no link
Lightweight0.3x for image posts and listed domains
Other item types0.5x for anything besides stories and polls
Contro-factorSquares points over comments past 20 comments
news.arc multiplies a story's decay score by whichever penalty factor applies before it reaches the front page.

Does the published formula still describe the live site?

No. The Arc release is the last public version of the ranking code, and Hacker News has changed the front page since then in ways moderators have described only in comments, including a second-chance pool that reintroduces older submissions and re-ranking passes that moderators trigger by hand. Nothing forces those descriptions to be complete or current. Treat the formula as a model of the shape of decay, then verify against the site: track a story's position against its points and age, and where the two diverge, a penalty or a manual action explains the gap.

How is Hacker News ranking different from Reddit's?

Hacker News runs one global front page from one formula, while Reddit ranks inside thousands of separate subreddits with their own sort options and moderator rules. A Hacker News story competes against every other story submitted that day, so the two-hour window carries almost all the weight, and a story that misses it does not get a second run from a niche audience. Reddit spreads the same submission across communities, and its point system feeds a per-user total that gates posting rights, covered in what is Reddit karma.

The practical difference is the recovery path. On Reddit you can post to a smaller, better-matched community and rank there. On Hacker News, the item counts as a duplicate on resubmission, so the first submission carries the whole result. Published item counts and API behavior for the platform sit in Hacker News statistics.

Someone reading on a laptop in a cafe reflects tracking a discussion thread after a story leaves the front page.

RedReplier
RedReplier

Get Started

Reddit, X, Bluesky & HN

Real-time intent alerts

Unlimited AI replies

Ranked by buyer intent

How do you track a story after it leaves the front page?

Watch the comments, because the discussion outlives the ranking. A story falls off the front page in hours while the thread underneath keeps drawing replies and pricing questions that never surface in a dashboard measuring your own posts. RedReplier covers this through Hacker News monitoring, alongside Reddit, X, Bluesky and Facebook in one place, ranking what it finds by buying intent and explaining with AI why each mention was flagged.

Set the keywords to your product name, your competitors, and the problem people describe before they know your category exists. The same keyword set runs across every platform RedReplier watches, documented under social media monitoring.

Frequently asked questions

What is the gravity constant in the Hacker News algorithm?

Gravity is 1.8 in news.arc, stored as gravity*, and it is the exponent applied to a story's age in the denominator. Raising the age to 1.8 instead of 1.0 makes rank fall faster than linearly, so a story at 24 hours divides by 352 instead of 26. Y Combinator has not published a value for the live site, so 1.8 is the last released figure and not a confirmed current one.

Does the number of comments affect Hacker News ranking?

In the released source, yes, and downward. The contro-factor function applies once a story has more than 20 comments and its comment count exceeds its points, multiplying the score by the square of points over comments. Moderators have separately described a flamewar detector in Hacker News comments, which pushes the same direction on heated threads.

Can you resubmit a story that did not get traction?

Hacker News treats a repeat submission of the same URL as a duplicate and routes votes to the original item instead of creating a fresh one. The age term in the formula therefore keeps running from the first submission. Moderators have described a second-chance pool that gives some older submissions another appearance on the front page, but no submitter controls entry to it.

Why does a story with fewer points sometimes rank higher?

Age is the reason in most cases: at one hour a story needs 41 points to match what a three-hour-old story achieves with 100. Penalty factors are the other reason, and they are invisible from outside, since the front page shows points and age but never the multiplier applied to them. A story ranking below its arithmetic position has either a source penalty or a moderator action on it.

Does upvoting your own submission help?

No, the formula subtracts one point before dividing, which cancels the submitter's own vote. The source also tracks a sockvotes field that realscore subtracts from the raw score, so coordinated voting reduces the number the ranking actually uses. Flags from users above a karma threshold can kill a low-scoring story outright.

Where can I read the Hacker News ranking source?

The news.arc file distributed with the public Arc release contains frontpage-rank, the constants gravity* and timebase*, and the penalty factors named in this post, and the community Anarki repository mirrors it. That file is the only ranking code Y Combinator has released. The version running on Hacker News today is not public, and the company has not committed to publishing it.

What happens when a story gets flagged on Hacker News?

The released source lets a user above a karma threshold flag a story. Once flags on a story under 10 points with no admin upvote pass a kill threshold, the code marks it dead and pulls it from the front page. A dead story stays off the ranking no matter what its score would otherwise be.

What is the Hacker News flamewar detector?

Moderators have described a flamewar detector in comment threads, not in documentation, as a mechanism that demotes threads where argument outruns votes. It sits outside the four penalties named in news.arc and has never appeared in released code. It pushes threads down alongside the contro-factor, which already squares points over comments once a story passes 20 comments with more comments than points.

Does a Hacker News post without a link get penalized?

A text post with no link carries a nourl-factor of 0.4 in news.arc, cutting its decay score to less than half of what an identical link post would score. Image posts and submissions from domains on the lightweights* list carry a separate 0.3 lightweight-factor, and item types other than stories and polls carry a flat 0.5 penalty. All three multiply the score after the age based decay, on top of whatever the formula already produced.

What is the Hacker News second-chance pool?

Moderators have described a second-chance pool that reintroduces older submissions to the front page, in comment threads rather than documentation or released code. News.arc, the only ranking source Y Combinator has published, contains no function for it. No submitter can request entry, and which stories qualify has never been made public.

See us more often in Google

One click marks RedReplier as a preferred source, so our articles sit higher in your Top Stories, AI Mode, and AI Overviews.

Before you go...

RedReplier

RedReplier

Catch every buyer asking for what you sell

RedReplier watches Reddit, X, Bluesky and Hacker News in real time, ranks every thread by buyer intent, and drafts your reply, so you get there first.

Reddit, X, Bluesky & HN

Real-time intent alerts

Unlimited AI replies

Ranked by buyer intent

Related Articles