The Lottery Matrix Case Study
Every Draw, Measured Against Chance
The Lottery Matrix is a statistics site for Powerball and Mega Millions that updates itself after every drawing from official results, and shows every number next to what pure chance would produce.
Project Overview
| Project | A live statistics site for Powerball and Mega Millions |
| Organization | The Lottery Matrix |
| Timeline | Built October 13 to 23, 2026. Live October 23, 2026 |
| At launch | Every Powerball draw since November 1997 (3,294) and every Mega Millions draw since December 2003 (2,388) |
| Services | Code audit, data sourcing and verification, automated updates, interactive statistics, homepage, search data, accessibility, and legal pages |
| Live site | thelotterymatrix.com |
The Challenge
In 2015 the Powerball Matrix was a small site that collected the winning numbers after every drawing and showed them in a grid: every number, broken down by the position it was drawn in. It went quiet around 2017. By 2026 its data source was gone, its history had stopped, and its code had been copied into more than a dozen near-identical pages.
A read-through of the original code found the grid worth keeping, and a list of problems worth fixing:
- The results file the site depended on now returns a 404
- Powerball has changed its ball ranges five times since 1997, and the old counts mixed them together. Of 2,096 archived draws, only 225 were played under today's rules, so older numbers looked "hot" simply because they had existed longer
- The headline count mixed white balls with the red Powerball, and a date filter compared dates as text, so it kept draws by month instead of by date
- Fourteen page variants, from Wednesday-only to averages, were the same hundred lines with small edits
- The original promised to find "a pattern in randomness," but every draw is independent
The rebuild had to be fun to explore without implying it could predict anything. Five decisions set the direction:
- Open to everyone and to search engines, with no accounts or sign-ups
- No ads: the old offshore lottery affiliate ads would not come back
- Powerball first, on a design that could take more games
- Official results, fetched in code from a government source rather than a scraped copy
- No social integrations and no contact forms
What Was Built
Scott Labz audited the original code, found and verified a new data source, and built the site from scratch: the data pipeline, one statistics engine for both games, the homepage, search data and the legal pages.
A homepage with one card per game
The homepage gives each game a card with its latest draw and a way into every view.
The red 13 ball
The logo's red 13 ball is also the favicon, and the footer is the brand red.
Every draw, measured against chance
The line sets the promise: the site explores the history, and doesn't claim to predict the next draw.
The latest draw
Each card shows the latest draw, how many draws are tracked, and the next drawing, worked out in Eastern Time.
Straight to a view
Links go straight to the matrix, hot and cold numbers, every draw and patterns for each game.
Plain-language legal pages
An Accuracy Statement (official results always win, no predictions, not affiliated with any lottery, play responsibly) and a Privacy Policy that matches what the site collects.
A source that keeps the order the balls were drawn
The matrix only works if the white balls arrive in the order they were drawn. Results feeds usually sort them low to high, which throws that away. Of the official sources checked, one state lottery agency's results file keeps the drawn order and updates within minutes of each drawing.
- Before trusting it, the file was checked against the original archive: all 817 drawings they share matched, with zero mismatches
- That joined the archive (1997 to 2010) and the official file (2010 on) into one continuous, verified Powerball history
- For Mega Millions, the same agency has every drawing since December 2003, and only about 1% of rows come out already sorted, which is what random order produces
Counts compared within one set of rules
Every game is split into rule eras: six for Powerball and five for Mega Millions. Each era's start date was checked against the data, and every era's ball numbers fit its rules exactly. Counts are only ever compared within one era, and the newest era is the default.
Each game's About tab lists its rule changes and where its numbers come from.
One set of rules at a time
The filter bar picks the era, and every count on the page follows it.
Six Powerball eras
Each era with its ball ranges and how many draws were played under it, from 515 in the first to 1,423 in today's.
Draw days and multipliers
Notes on when Monday drawings began and when multipliers first appear, so a filtered view reads correctly.
Where the numbers come from
Each game names its sources and how they were checked against each other.
The matrix, measured against chance
The original grid was worth keeping: how often each ball came out 1st, 2nd, 3rd, 4th or 5th, with the columns spelling the game's name. The rebuild colors every cell by its distance from chance, in standard deviations.
The Powerball matrix for today's rules: 1,423 draws, every ball by the position it was drawn in, under columns that spell P-O-W-E-R.
Latest draw and data check
The newest draw and when the data was last checked, at the top of every view.
Filters saved in the link
Rule era, draw day and a recent window replace the old one-page-per-variant approach. Every view is saved in the link, so it can be bookmarked or shared.
How much color chance creates
Gray is ordinary noise, blue is colder than chance and red is hotter. Each view says what a fair machine would leave outside ±1σ and ±2σ, about 32% and 5%, and what this view shows: 35% and 5%.
Counts or shares
Each cell can show its count or that ball's share of its own draws.
The Powerball alongside
The red ball's own counts, and how many draws since each one last came up.
An outlier, explained
Ball 23 has come out 4th 37 times against 20.6 expected (+3.6σ). With 345 cells in the grid, chance produces about one cell that extreme, so the site shows it and explains why it isn't a signal.
- Expected values are exact odds, not past averages, worked out from the math of drawing five balls without replacement
- The color steps were checked for even lightness, and every value is printed, so color is never the only signal
Hot and cold numbers, in context
Hot and cold numbers, each one next to what chance expects.
Expected, with its normal range
The line marks what chance expects, 103.1 draws per white ball under today's rules, and the band shows the normal ±2σ range around it.
Hot, and still ordinary
Balls past +2σ show in red. Across 69 balls, chance alone puts a few there, and the page says streaks don't change the odds of the next draw.
Every number against the odds
Each ball's draws, its distance from chance, and its hit rate next to the 1 in 13.8 that chance predicts.
Since last and longest gap
How many draws since each number last came up, and its longest wait.
Every draw since 1997
The full history, 30 days at a time, with 13 and 21 highlighted.
Highlight any numbers
Type numbers to circle them across the history, or show only the draws that include them. Here, 13 or 21 appears in 301 of 1,423 draws.
30 days at a time
The history pages by 30 days, newest first, with jumps to either end.
Each draw, broken down
The sum, odd-even and low-high split for every draw, with the Power Play multiplier.
Matches, circled
Highlighted numbers are circled wherever they appear, including the Powerball.
Patterns, each against exact odds
Patterns people look for, each one next to how often a fair machine produces it.
Is it random?
Three randomness checks, on the white balls, the draw-position matrix and the Powerball. All three come back consistent with chance.
Odd-even and low-high
How often each split comes up, next to how often it should.
The sum of the five balls
Actual draws against the exact distribution of sums.
Consecutive numbers and repeats
Pairs like 23 and 24, repeats from the previous draw, "birthday" picks of 31 and under, and the Powerball matching a white ball.
The birthday paradox
No set of five white balls has come up twice yet, against an 8.6% chance of at least one by now.
- The randomness checks are chi-square tests, corrected for drawing five balls without replacement
One engine, two games
The original fourteen pages became one shared engine and a small settings file per game: ball names, draw days, rule eras and About text. Mega Millions reused all of it and added its own touches.
The Mega Millions matrix: same engine, with M-O-N-E-Y across the columns and a gold Mega Ball.
The gold Mega Ball
Mega Millions keeps its own colors: the Mega Ball is gold.
Switch games in one tap
Each game page links to the other.
Five Mega Millions eras
The newest started in April 2025, and it's the default view.
Small numbers, said plainly
With 161 draws under the newest rules, chance expects 2.3 per cell, and the page says so.
Mega Ball 1 to 24
The Mega Ball's own counts, for its current range.
- Adding a game means filling in a settings file, adding a data source and a homepage card
Updates itself after every drawing
- A scheduled job runs the morning after each Powerball drawing (Monday, Wednesday and Saturday) and each Mega Millions drawing (Tuesday and Friday), plus a daily safety pass
- Every incoming row is checked: a valid date, five different white balls within that era's range, and a bonus ball and multiplier within bounds
- A short or failed download never overwrites the last good copy, and unchanged data costs one request and no write
- The whole Powerball history since 1997 downloads as about 33 KB compressed, and every statistic is worked out in the browser
- Plain HTML, CSS and JavaScript, with no build step, no framework and no dependencies
Found by search
- Search-friendly titles and descriptions, canonical addresses, a sitemap and robots file, and the www address redirected to the bare domain
- Structured data for the site, each page and its breadcrumbs, each game as a web application, and each draw history as a dataset, which makes it eligible for dataset search
Tested in a real browser, on any screen
The Powerball matrix on a phone, with the whole grid still on screen.
Both games in reach
The game switch sits under the title.
Latest draw first
The newest draw and the data check stay at the top.
Filters that stack
The filters go full width, and tapping one no longer zooms the page in.
Tabs that scroll
The five tabs scroll sideways when they don't fit.
The whole grid, sized for a phone
All five draw positions stay on screen.
- Every tab, filter, sort, toggle, pager and tooltip was driven in a real browser at desktop and phone widths, on the local build and the live site
- Fixed before launch: back and forward didn't update the view, dropdowns lost keyboard focus after each change, phones zoomed in when a dropdown was tapped, and a render bug blanked the Draws table
- Every chart has a table version, so nothing depends on hovering, and contrast was checked for each heat step
The Results
The Lottery Matrix went live on October 23, 2026, with both games updating on their own after every drawing.
- Every Powerball draw since November 1997 across six verified rule eras, and every Mega Millions draw since December 2003 across five, where the old site had stopped in November 2017
- The key figures were recounted in a separate script straight from the raw official files, and every one matched the live pages
- All three Powerball randomness checks come back consistent with chance
- Fourteen copied pages replaced by one engine and a settings file per game
- A page-quality audit of the live homepage scored 99 for performance on desktop, and 100 for best practices and SEO on phone and desktop
- No ads, where the old site ran offshore lottery affiliate ads
Business Impact
The Lottery Matrix keeps itself current from official results and is plain about what the numbers mean. Every statistic sits next to what chance would produce, so the site is fun to explore without suggesting it can predict a draw.
Built on one engine, the next game is a settings file, a data source and a homepage card away. Through web application development and data work, it follows the same habits as client projects: check the source before trusting it, recount the numbers independently, and test in a real browser.
Explore More Case Studies
Start the Conversation
Numbers people can trust don't happen by accident. They're built deliberately, from the source checks to the last recount, so the data you show is data you can stand behind.
cott Labz