Magic 8-Ball Generator

Ask a yes/no question, shake the ball, get one of the twenty canonical Mattel answers. Browser-only, no Math.random, every answer has exactly the same one-in-twenty chance per shake. The ball is gently optimistic on purpose: ten yeses, five maybes, five nos, exactly as it has shipped since 1950.

Explain like I'm 5 (what even is this calculator?)

You think of a yes-or-no question, you tap the ball, and a little message floats up from inside it. Sometimes it says yes, sometimes no, sometimes "ask again later". Same thing as the plastic ball your nan had on the shelf, just on a screen and with the dice rolled fairly.

Ask the ball

Browser-only. Your question never leaves the device. The answer is drawn using the Web Crypto API for an unbiased pick.

The ball does not actually read it. The question is just for your own benefit, so you remember what you asked.

Prove it

The answer is one of exactly 20 strings, the canonical Mattel set, drawn with the browser's cryptographic random source. Here is the order of operations:

  1. Read the 20 canonical answers from the frozen list (10 affirmative, 5 non-committal, 5 negative).
  2. Draw an integer in [0, 20) using crypto.getRandomValues with rejection sampling, so every answer has exactly the same chance.
  3. Look up the answer at that index and display its text and tone.
  4. Push a calculator_result dataLayer event with the chosen tone (Affirmative, Non-committal, or Negative) for analytics.

Total bits drawn per shake: 32 (one Uint32 read from the browser RNG). For n = 20, (2^32) mod 20 is 0, so the rejection sampler accepts every draw. There is no Math.random in the path. Same primitive your bank uses for session keys.

// Unbiased integer in [0, n)
function randomInt(n) {
  const max = 0xFFFFFFFF;
  const limit = max - ((max + 1) % n);
  const buf = new Uint32Array(1);
  while (true) {
    crypto.getRandomValues(buf);
    if (buf[0] <= limit) return buf[0] % n;
  }
}

// Draw one of the 20 canonical answers
const answer = ANSWERS[randomInt(20)];

Nothing leaves the device. The page makes no network requests after it loads. Disconnect your network and the ball still answers.

Useful? Save this calculator: press Ctrl + D to bookmark it.

When asking a plastic ball is a perfectly reasonable thing to do

Two equally good options, neither side budging, the discussion going round in circles. Pizza or curry. Cinema or pub. Stay in or go out. The decision is small, the deliberation is taking longer than the activity will, and someone has to break the tie. The ball decides. Not because it knows anything, but because it removes the social cost of one person picking. If the loser feels strongly enough to argue with the result, the question was never actually 50/50 and you have new information about what they actually wanted.

Children at a sleepover, party games, a dull Tuesday evening. The ball is a tiny piece of theatre that costs nothing to run. Type a question, shake, watch a face appear. The drama is the feature: the moment between the shake and the answer is where the fun lives. It does not really matter what the ball says. It matters that everyone watched the same answer come up.

Writers and creatives use it as a procrastination cure. Stuck on whether to cut a scene, kill a character, change the tense, give the protagonist a dog. Ask the ball. The answer does not bind you, but the gut reaction does. If the ball says "no" and your stomach drops, you wanted to keep the scene. If it says "yes" and you feel relieved, you wanted to cut it. The ball is a coin flip with better branding.

A short, slightly suspicious history

The Magic 8-Ball was invented by Albert Carter in the 1940s, supposedly inspired by a fortune-telling device his clairvoyant mother used. Mattel acquired the design in 1971 and has been selling it largely unchanged ever since. The 20 answers, the icosahedral floating die inside, the blue-tinted alcohol fluid, the cheerful bias toward "yes": all of it has been the same for nearly seventy years. The ball is older than the personal computer, the mobile phone, and the public internet. It still sells. There is something to be said for not over-engineering a good idea.

Common mistakes to avoid

Asking it open-ended questions. The ball only does yes/no. "What should I have for dinner?" returns "Most likely" and you are no further forward. Phrase the question as a yes/no first ("Should I have curry tonight?") and the answer is at least parseable. The Decision Wheel is the right tool for picking between named options.

Asking it the same question repeatedly until you get the answer you want. This is funny once and depressing twice. If you are doing this, you already know what you want and the ball is just stalling for you. The right move is to put the kettle on and admit it to yourself.

Treating it as a serious decision-making tool. The ball is a fairground oracle. It does not know your situation, your budget, your medical history, or whether your landlord is reasonable. For real decisions, talk to a real person who knows the specifics. The ball is for tiebreakers and fun.

Edge cases this page handles

  • No question entered. The ball still answers. The question is purely for the user's own benefit.
  • Question over 200 characters. Capped at 200, because the ball does not read it anyway.
  • Repeat shakes. Each shake is an independent draw. Two affirmatives in a row are exactly as likely as the maths says (one in four).
  • Reduced motion. The shake animation respects prefers-reduced-motion: the answer still appears, the wobble does not.
  • Offline. Page works fully offline once loaded. No network calls during a shake.

Related calculators

The 8-ball gives a yes/no. These hand back other shapes of answer.

Frequently asked questions

Are these the real Magic 8-Ball answers?

Yes. All 20 answers are the canonical Mattel set in their canonical order: 10 affirmative, 5 non-committal, 5 negative. Nothing has been added, swapped, or sanitised. The text on screen is what you would read on the bottom of a real ball if you got bored and shook it for long enough.

Is the answer actually random?

Yes. The answer is drawn using crypto.getRandomValues with rejection sampling, the same primitive browsers use for session keys. No Math.random anywhere. Each of the 20 answers has exactly the same one-in-twenty chance per shake.

Does my question get sent anywhere?

No. The question stays in the textbox on your device. The page makes no network calls during a shake. Disconnect your network and the ball still works.

Why are there more yes answers than no answers?

That is the original Mattel split: ten affirmative, five non-committal, five negative. So fifty per cent yes, twenty-five per cent maybe, twenty-five per cent no. The ball is gently optimistic by design, which is part of why it has sold for nearly seventy years.

Should I use this to make actual decisions?

For breaking a deadlock between two reasonable choices, sure. For anything that genuinely matters (jobs, relationships, money, health), no. The ball is a fairground oracle, not a financial adviser. Its value is the moment after the answer appears, when you notice your gut reaction to it.