123LuckyNumber is a free lottery number generator that draws your numbers on a realistic 3D ball machine in your browser. It is built to be fair and private: every number comes from a cryptographically secure random generator, and nothing about you or your draws is sent to a server.
How a draw works, step by step
- The numbers are drawn first. Before any ball moves, your browser's Web Crypto API (
crypto.getRandomValues) draws every number of the ticket. Each draw uses rejection sampling, so no number is even slightly more likely than another, and a lotto pool is drawn without repeats, like balls taken out of a machine. - The machine runs on its own. Air jets blow the balls around the chamber with real physics: gravity, bounces and collisions between balls. The pickup at the top catches whichever ball the air delivers.
- The numbers are moved to match. Balls of one colour look the same except for their number, so the drawn number is moved onto the ball that is about to be caught, while neither number can be seen: deep in the pile, behind a part of the machine or turned away. The machine runs a little ahead of what you see, so it can wait for such a moment; only if none comes in time does a number change in view. Once a ball is on its way to the rack, its number never changes.
- The ball rolls to the rack, and the number joins the result at the top of the screen.
Why not let the physics pick the number?
Because a simulation is not a fair random source. Small details of the starting positions, the time step and rounding can make some balls come out more often than others, and nobody can prove they do not. A cryptographic generator is designed and tested to be unpredictable and uniform. Separating the two gives you the best of both: a draw that looks real, and a result you can trust.
The lotteries
Each preset is what a player picks on a ticket: for Powerball, 5 numbers from 1–69 and 1 from 1–26. Digit games such as Pick 3 or 4D draw each digit from its own ten balls, so a digit can repeat. Each format is checked against its operator's own website; formats change from time to time, so your official lottery's rules always apply. The machine starts on a lottery from your country, found once per visit from your IP address (see the privacy policy), and you can switch to any other or set up a custom draw.
Built on
- three.js for the 3D rendering (MIT licence)
- A small ball physics engine written for this machine
- IP-to-country data from DB-IP (CC BY 4.0)
- Plain PHP on the server, with no database, no accounts and no tracking
Everything is served from this site rather than a third-party CDN, so the page never loads code from anywhere else.
Part of the 123 family
123LuckyNumber sits alongside 123DiceRoller, 123SpinWheel and our other free, no-sign-up tools. Questions, ideas or a bug to report? Email hello@123luckynumber.com.
Last updated