---
answer: direct
beat: system-design
source: 1 article · updated: August 16, 2026
---

How does HyperLogLog count unique items without storing them?

It hashes every item and examines the distribution of leading zeros in the binary hash output. Since leading zeros are rare (like flipping heads repeatedly), observing many leading zeros statistically implies you've hashed billions of distinct items.

Answered in

Count Billions in 12 Kilobytes

HyperLogLog estimates cardinality by reading leading zeros in hashed values, trading 1% error for fixed memory.

Crashtech Editorial August 16, 2026 System Design

Read the full analysis

Other questions this article answers

More system design questions

Every answer on Crashtech is written by the editor of the article it comes from — never auto-summarised. Browse all answers or the System Design beat.