Lotto 6/49 Simulator

A Lotto 6/49 simulator that lets you play thousands of draws in seconds. Built to make the odds real, not just theoretical.

StatusCompleted
Period2022
Tech
ReactViteTypeScriptTailwind CSSChart.jsVitesti18nextPWA
Introduction

This started as a Reddit Post. Someone in the UK had built a similar simulator for the British lottery, and the comments were full of people genuinely surprised by how rarely they won after thousands of tries. I wanted the same thing for Loto-Québec.

The concept is simple: simulate as many draws as you want, watch your spending climb, and let the numbers do the talking. No warnings, no editorializing, just probability playing out at scale. It works as a social experiment because everyone has bought a ticket at some point. Showing someone 5,000 draws where they spent $15,000 and won $500 lands differently than any statistics class.

Tech

React 19 with Vite and TypeScript for the core. Chart.js handles the visualizations. The charts are what make the results land visually instead of just numerically. The draw engine has its own unit tests in Vitest, which is an interesting problem since you can't assert an exact output, only that results fall within expected distributions. The app is also bilingual via i18next and ships as a PWA, so it can be installed on mobile and runs offline.

What I learned

Building the simulation loop was genuinely fun. Figuring out how to run thousands of draws without locking up the UI was a satisfying problem. Testing probabilistic logic with Vitest was new territory: you can't assert an exact result, so you end up testing the shape of distributions instead. The bigger challenge was the UI. The app generates a lot of data, and the real work was deciding what to surface, what to hide, and how to present it in a way that actually means something to someone looking at it on their phone.