About
About Infinite Monkey
Infinite Monkey is a playful take on a famous idea: the infinite monkey theorem. It states that a monkey hitting keys at random on a typewriter for an infinite amount of time will almost surely eventually type any given text — including the complete works of Shakespeare.
You don't have infinite time. So the question this site asks is simpler and a lot more fun: how far can your monkey get?
How it works
When you launch a monkey, your own browser starts generating random keystrokes as fast as it can, checking each attempt against the opening of Hamlet's “To be, or not to be” soliloquy. We track the longest run it nails from the very first letter — that's your streak.
- All the randomness is computed in your browser, across as many CPU cores as you allow.
- Turn on hardware acceleration to run the trials across every CPU core instead of just one.
- Your best streak is submitted to a global leaderboard so you can see how your monkey stacks up against everyone else's.
The odds
The monkey's keyboard has 31 keys — every distinct character used in the passage (its letters, plus spaces, punctuation and line breaks). On any single press, the chance of landing the one correct next character is 1 in 31.
Because a streak has to match from the very first letter, the presses are independent and their odds multiply. Reproducing k characters in a row has probability (1/31)k, so on average it takes about 31k attempts. Every extra character is another ×31 on top of the last — the difficulty doesn't add up, it compounds. That exponential is why a few characters is easy and a dozen is brutal.
Roughly how many random attempts each streak takes:
- 1–4 chars: 31 → ~924,000 attempts — over in a blink.
- 5 chars: ~28.6 million attempts (a second or two).
- 6 chars: ~888 million attempts.
- 7 chars: ~27.5 billion attempts.
- 8 chars: ~853 billion attempts (hours, even on every core).
- 9 chars: ~26 trillion attempts (days).
- 10 chars: ~820 trillion attempts — a fast machine running flat out is looking at months.
And the whole passage? All 602 characters would take on the order of 31602 attempts — that's roughly 10⁸⁹⁸ (a 1 followed by ~898 zeros). For scale, there are only about 10⁸⁰ atoms in the observable universe. Every computer that has ever existed, running for the entire age of the universe, would not get a meaningful fraction of the way there. That is the whole joke of the theorem: almost surely still needs infinite time — and you don't have it. So aim for a personal best instead.
Enough reading — launch a monkey →