⏱️ Lectura: 12 min

20% of the stories that make it to Hacker News’ front page are penalized at some point during the day. That’s confirmed by an analysis that reconstructed Hacker News’ ranking story by story over several consecutive days.

📑 En este artículo
  1. TL;DR
  2. What the Hacker News ranking analysis revealed
  3. The real formula behind Hacker News’ ranking
  4. How Hacker News reorders without recalculating everything
  5. The hidden penalties: what triggers them
    1. The controversy penalty
  6. How to test it yourself with Hacker News’ official API
  7. Impact and analysis: what this means for the community
  8. What’s next for Hacker News’ algorithm
  9. Frequently Asked Questions
    1. What formula does Hacker News use for its ranking?
    2. Why doesn’t my story with lots of votes reach the top spot?
    3. What is the controversy penalty?
    4. Does Hacker News still penalize titles containing “NSA”?
    5. Can I reproduce this analysis with my own data?
    6. What does “gravity” mean in this context?
  10. References

The public scoring formula has been known for years, but questions remained open. Does the published code reflect the real algorithm? Are there invisible factors beyond votes? This article answers with concrete data: the formula, the reordering mechanism, and the penalties Hacker News applies without warning.

TL;DR

  • Hacker News’ public formula combines votes and age; time carries more weight, so every score eventually drops to zero as the hours pass.
  • A multi-day analysis of Hacker News’ top 60 found that 20% of the front page carries some active penalty.
  • Titles containing ‘NSA’ received an automatic 0.4-point penalty, according to the original 2013 analysis.
  • ‘Controversial’ stories, those with many comments relative to few votes, receive a severe penalty once they pass 40 comments.
  • Popular domains like medium.com, github.com, or theguardian.com carried automatic penalties of between 0.25 and 0.8 points.
  • Each vote only reorders that specific story; on top of that, every 30 seconds the system randomly re-evaluates one story from the top 50 to prevent stale positions.
  • The site caches its pages for 90 seconds, so a position change doesn’t show up instantly for every user.

What the Hacker News ranking analysis revealed

Ken Shirriff, an engineer known for his retro hardware teardowns, applied the same forensic method to a much more everyday system: Hacker News’ front page. Over several days in November, he logged the raw score and the actual position of the top 60 stories every few minutes. The result was a graph comparing two lines: the story with the highest raw score at any given moment, and the story Hacker News actually displayed in the number one spot. They almost never match.

The examples he documented are telling. Getting website registration completely wrong reached the top spot early, but a controversy penalty sank it within minutes. Apple Maps met the same fate shortly after. Snapchat reached the top and then vanished from the top 60 entirely after a severe penalty hit at 8:22 in the morning. Why you should never use MongoDB was one of the most upvoted stories of the day, but it stayed boxed in around position 7 for hours. And Severing ties with the NSA started off with an automatic penalty for its title, but it was popular enough to reach number one anyway, until Hacker News hit it with an even bigger penalty.

For a developer posting on Hacker News hoping for traffic to their project, this changes how you should read the phenomenon. Racking up votes isn’t enough: the domain you’re posting from, the amount of discussion your comments generate, and even certain words in the title can weigh as much as the upvotes themselves.

A story can lead the front page and lose the top spot within minutes because of a penalty. Foto de Towfiqu barbhuiya en Unsplash

The real formula behind Hacker News’ ranking

The public scoring mechanism combines two variables: the votes a story receives and the hours elapsed since it was posted. The more votes, the higher the score climbs; the more hours pass, the lower it drops. The key is that the exponent penalizing time is larger than the one rewarding votes. That asymmetry, known as gravity, guarantees that no story stays stuck on the front page forever, no matter how many upvotes it racks up.

The original analysis doesn’t publish the exact numerical value of gravity, but it confirms the behavior: a freshly posted story with few votes can climb quickly, peak within the first hour or two, and then begin a slow decline that accelerates over time. That pattern, combined with the fact that most votes arrive in the first few hours, explains why the score curves in the study’s graph climb steeply and drop even faster.

You can reproduce the general shape of the formula in any language. This JavaScript example uses an illustrative gravity value, not officially confirmed, to show how the calculation behaves:

function hnScore(points, submittedAt, now = Date.now(), gravity = 1.8) {
  const ageInHours = (now - submittedAt) / (1000 * 60 * 60);
  return (points - 1) / Math.pow(ageInHours + 2, gravity);
}

// Story with 120 votes and 3 hours of age
const score = hnScore(120, Date.now() - 3 * 60 * 60 * 1000);
console.log(score.toFixed(2));

With gravity fixed at 1.8 (a common value in Hacker News-inspired implementations, not the official one), a story with 120 votes and 3 hours of age weighs much less than one with half the votes and just 20 minutes of life. That’s why a brand-new story can jump to the front of the page even with fewer total points than one posted hours earlier.

How Hacker News reorders without recalculating everything

It would be inefficient to recalculate the score of thousands of active stories every time someone visits the site. Hacker News solves this by reordering one story at a time. When a user votes on a story, the system recalculates that specific story’s score and moves it to its rightful place in the list; the rest of the stories stay untouched.

The problem with that shortcut is that a story can stay in a high position if it stops receiving votes, even if it no longer deserves the spot. To avoid this, every 30 seconds Hacker News randomly picks a story from the top 50 and reorders it, even if no one has voted on it at that moment. On top of that, the site’s pages are cached for 90 seconds, which means a position change can take up to a minute and a half to reach every visitor.

flowchart TD
    A["User votes on a story"] --> B["That story's score is recalculated"]
    B --> C["The story is reordered in the list"]
    D["Every 30 seconds"] --> E["A random story is picked from the top 50"]
    E --> B
    C --> F["Page served from cache"]
    F --> G["Cache expires every 90 seconds"]

The hidden penalties: what triggers them

The votes-and-time formula is only half the story. On top of that raw score, Hacker News applies a layer of penalties that’s rarely documented publicly, one the analysis managed to isolate by comparing each story’s raw score against its actual position.

Penalty typeWhat triggers itApproximate magnitudeReal example
By word in the titleThe title contains “NSA”Fixed penalty of 0.4 points“Severing ties with the NSA”
By domainThe story links to a high-volume site (medium.com, github.com, theguardian.com, among others)Between 0.25 and 0.8 pointsStories from arstechnica.com or businessinsider.com
By controversyThe story passes roughly 40 comments with a high ratio of replies to votesSharp, sustained drop in position“Apple Maps”, “Getting website registration completely wrong”
Manual or hiddenEditorial decision or moderation reports not publicly documentedCan remove the story from the top 60 entirely“Snapchat” disappeared from the ranking at 8:22 am

It’s unclear whether these penalties are applied by the Hacker News team by hand, story by story, or whether they come from automatic rules triggered by user reports. The analysis itself leaves this open: the evidence shows the effect, not who’s pulling the trigger.

The controversy penalty

Of all the documented penalties, the controversy one is the most aggressive. A story that racks up many comments relative to its votes, typically a sign of a heated discussion rather than consensus, starts losing positions as soon as it crosses the 40-comment threshold. Why you should never use MongoDB is the textbook case: it was one of the most upvoted stories of the day, but the penalty kept it boxed in around position 7 for hours, far from where its votes would have carried it.

A story can drop out of the top 60 within minutes if the system applies a severe penalty. Foto de Kaptured by Kasia en Unsplash

How to test it yourself with Hacker News’ official API

Hacker News exposes a public, authentication-free API, backed by Firebase, that lets you pull the live ranking and cross-check it against your own raw score calculation. With that, you can detect, right now, which stories are underperforming relative to what their votes suggest.

The endpoint https://hacker-news.firebaseio.com/v0/topstories.json returns up to 500 ids ordered by the actual ranking. The endpoint https://hacker-news.firebaseio.com/v0/item/{id}.json returns each story’s data: points, submission time, and comment count (descendants). That’s enough to reconstruct the experiment:

import requests
import time

BASE = "https://hacker-news.firebaseio.com/v0"

def hn_score(points, time_submitted, gravity=1.8):
    age_hours = (time.time() - time_submitted) / 3600
    return (points - 1) / (age_hours + 2) ** gravity

top_ids = requests.get(f"{BASE}/topstories.json").json()[:60]

stories = []
for rank, story_id in enumerate(top_ids, start=1):
    item = requests.get(f"{BASE}/item/{story_id}.json").json()
    raw = hn_score(item.get("score", 0), item.get("time", 0))
    stories.append((rank, item.get("title"), item.get("score"), raw))

for rank, title, points, raw in sorted(stories, key=lambda s: -s[3])[:10]:
    print(f"real_rank={rank:2d}  raw_score={raw:6.2f}  votes={points:4d}  {title}")

If you sort the output by raw_score and compare it against real_rank, the stories where the actual ranking falls far below what the raw score suggests are the candidates for being penalized. It’s the same method the original analysis used, adapted to today’s public API.

💭 Key point: The fact that the time exponent is larger than the votes exponent isn’t a minor detail: it’s what keeps yesterday’s viral story from still blocking today’s front page. Without that asymmetry, Hacker News would freeze around a handful of eternal stories.

Impact and analysis: what this means for the community

The fact that a site with Hacker News’ reputation for technical neutrality applies undocumented penalties creates real tension. On one hand, without them, the front page would end up dominated by big sites receiving duplicate submissions of the same story from different users, inflating votes that don’t reflect real merit. On the other hand, the lack of transparency about which words, domains, or comment thresholds trigger a penalty leaves posters with no way to know in advance whether their story will compete on equal footing.

One important clarification: these numbers come from an outside observation made in 2013, not from official Y Combinator documentation. Hacker News never published the full list of penalized domains or the exact gravity value, and there’s no guarantee the weights have stayed the same over time. The analysis’s own author later updated his article to clarify that the automatic penalty on titles containing “NSA” was no longer being applied. It’s proof that the system adjusts silently, with no public changelog.

⚠️ Heads up: None of these weights are official. If you reproduce the experiment with the public API, you’ll see the effect of the penalties, but not a list confirmed by Hacker News of what triggers them or how much they weigh today.

What’s next for Hacker News’ algorithm

The “NSA” penalty case shows the most likely pattern going forward: targeted adjustments, applied without notice, that the community only detects when someone repeats the same reverse-engineering exercise. Meanwhile, the public API remains the only reliable window for any developer who wants to understand, with their own data, why a story rises or falls.

📖 Summary on Telegram: View summary

Try it yourself: run the Python script against topstories.json right now and check how many stories on the current front page are underperforming relative to what their raw score suggests.

Frequently Asked Questions

What formula does Hacker News use for its ranking?

It combines a story’s votes with the hours elapsed since it was posted, with time weighing more heavily than votes. That asymmetry, called gravity, makes every story’s score trend toward zero as the hours go by, according to the original analysis.

Why doesn’t my story with lots of votes reach the top spot?

Because the raw score isn’t the only thing that decides position. Hacker News applies penalties for domain, for controversy, and, in the past, for certain words in the title, which can sink a story even if it has more votes than the ones above it.

What is the controversy penalty?

It’s the penalty triggered when a story accumulates many comments relative to its votes, generally past the 40-comment mark. The effect is a sharp drop in position, even if the story had been leading the front page.

Does Hacker News still penalize titles containing “NSA”?

No, according to the analysis author’s own later clarification: the automatic penalty on that word was removed after the original article was published in 2013. It serves as an example of how these weights change without public notice.

Can I reproduce this analysis with my own data?

Yes. Hacker News’ public API requires no authentication and exposes both the actual ranking and the raw data for each story, enough to calculate your own raw score and compare it against the real position.

What does “gravity” mean in this context?

It’s the name given to the exponent applied to time within the scoring formula. The larger that exponent relative to the one applied to votes, the faster a story falls off the front page as the hours pass.

References

📱 Enjoy this content? Follow @programacion on Telegram for daily tech content in Spanish: quick summaries, fresh content every day.

Categories: Seguridad

Clara Vásquez

Cybersecurity analyst focused on critical vulnerabilities, zero-days, and emerging threats. Covers high-impact CVEs, malware analysis, ransomware incidents, and security trends with a LATAM lens.

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.