built a fast, privacy-first Random Picker Wheel using Web Crypto API & Rejection Sampling (No Backend, No Tracking)
Hey devs! π I recently built and launched SpinWheelFly, a free, browser-based decision wheel and random picker tool. While there are plenty of spinner wheels online, most of them rely on basic Math.random(), force users
Hey devs! π
I recently built and launched SpinWheelFly, a free, browser-based decision wheel and random picker tool.
While there are plenty of spinner wheels online, most of them rely on basic Math.random(), force users through account sign-ups, or send user lists to a backend server. I wanted to build something lightweight, genuinely fair, and 100% client-side.
π οΈ Under the Hood & Key Technical Features
β’ Cryptographically Secure Randomness: Instead of standard Math.random(), the wheel uses the browser's crypto.getRandomValues() API to ensure true unpredictability.
β’ Zero Modulo Bias (Rejection Sampling): Mapping random integers onto a list of N entries using a simple modulo (%) introduces a slight statistical bias when N isn't a power of two. I implemented rejection sampling so every single slice has a mathematically identical probability of winning.
β’ 100% Client-Side & Zero Database: Everythingβyour entries, spin history, color themes, and saved wheelsβruns and stays strictly in your browser (localStorage). Nothing is ever sent to a server.
β’ Stateless URL Sharing: Want to share a custom wheel with a team or stream? The "Copy wheel link" feature serializes and packs the entries, wheel title, and color theme directly into the URL parameters. Anyone with the link loads the exact same state without needing an account or database lookup.
β’ High Capacity & Performance: Handles up to 1,000 entries smoothly on a responsive canvas, dynamically scaling text labels and switching font contrast automatically across 4 themes (Bright, Teal & Amber, Pastel, and Dark).
β’ Accessibility & Keyboard Support: Full keyboard navigation (Space/Enter to spin, Ctrl + Enter from the input list) and screen-reader announcements for winners.
π― Built-in Utilities
Beyond basic spinning, I added a few quality-of-life features for giveaways, stand-ups, and classrooms:
β’ Auto-removal of winners for elimination draws.
β’ Batch Winner Draw (pick 2, 3, 5, or 10 unique winners at once).
β’ Random Team Generator (shuffles and deals entries evenly into 2 to 8 teams).
β’ 40+ Ready-made presets (Yes/No, Dice, Numbers, Icebreakers, etc.).
Iβd love for you to test it out, break it, or share feedback on the UI/UX and performance!
Try it live: https://spinwheelfly.com/
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.