Random Number Generator App: Build One That Fits Your Use Case
Every stock random number generator on the web is the same: two inputs, one button, one number. That widget covers about 10 percent of the things people actually mean when they search for one. This guide shows you how to build the other 90 percent in under a minute.
The problem with generic RNG sites
Search "random number generator app" and you get the same three or four sites that have been around for a decade. They all do exactly one thing: take a min and a max, return an integer. That is useful when you want one number. It is not useful for the real reasons people reach for an RNG:
- Draw a raffle winner and keep drawing without hitting the same person twice.
- Roll 4d6 drop lowest for a D&D stat, six times in a row, with the totals visible.
- Pick from a named list (employees, slack handles, grocery items) not a number.
- Weight some options more heavily than others.
- Split 23 people into 4 balanced teams.
- Generate secure random codes using the Web Crypto API, not Math.random().
None of those fit the stock widget. All of them fit one sentence into mk0r.
Five prompts for five real use cases
Paste any of these into mk0r as-is. Each one produces a working single-file app in Quick mode.
Raffle with no repeats
Build a raffle drawer. I paste a list of names into a textarea, hit Draw, and it picks one at random. It must not pick anyone twice until I hit Reset. Drawn names move to a "winners" list with a timestamp. Remember state in localStorage so a refresh does not reset it.
Weighted picker
Build a weighted random picker. Each row has a label and a weight (integer). Big Pick button shows the result large. Show the effective percentage next to each row so I can sanity check the weights. Add an "add row" and "remove row" button.
Tabletop dice set
Build a dice roller for D&D. Buttons for d4, d6, d8, d10, d12, d20, d100. Input for count and a checkbox for "drop lowest". Show individual dice, modifier, and total. Keep a log of the last 20 rolls below.
Team shuffler
Build a team splitter. I paste names, pick K teams, it distributes them evenly. If N is not divisible by K, spread the remainder. Shuffle button reshuffles without changing K. Copy-to-clipboard button for each team.
Secure code generator
Build a secure random code generator. Length slider (4 to 64), toggles for uppercase, lowercase, digits, symbols. Use crypto.getRandomValues, not Math.random. Big copy button. Show entropy in bits.
Try it right now
Pick the prompt that matches your use case, paste it into mk0r, and watch the app stream into existence.
Open mk0r →What the output actually looks like
Quick mode returns a single standalone HTML file. The randomization lives in a plain JavaScript function you can read and edit. Here is the shape of what you get back (simplified):
Two things matter about this:
- The pool is a plain array. Add, remove, or rename items with any editor. Or ask mk0r to do it: "add Alice, Bob, and Carla to the pool".
- The random source is a single line. Default is Math.random(). If you want Web Crypto, say "use crypto.getRandomValues" and that line becomes
crypto.getRandomValues(new Uint32Array(1))[0] / 2**32instead. Nothing else changes.
Math.random() vs crypto.getRandomValues
Most people do not need to care. Math.random() is deterministic per session but statistically uniform and perfectly fine for raffles, dice, party games, and team shuffles. If any of the following is true, ask for Web Crypto instead:
- Real money or legal prizes are on the line.
- The output is a secret (password, access code, token).
- A user could benefit from predicting the next value.
The generated file will swap the one line and keep everything else identical. No library install, no build step.
Follow-up prompts that earn their keep
- "Add a confetti burst when a name is drawn." Obvious once you see it. Makes a raffle feel like a raffle.
- "Let me lock in certain picks so reshuffle leaves them alone." Useful for team shufflers where two people must be on the same team.
- "Export the draw history as CSV." Paper trail for any draw where someone might ask later.
- "Seed the RNG from a string I type, so the same seed always gives the same result." Reproducible randomness for testing or for auditable draws.
- "Show the full distribution after 10,000 simulated draws as a bar chart." Sanity check that your weighted picker is doing what you think.
When to use VM mode instead
Quick mode (single HTML file) covers almost every RNG use case. Go to VM mode if you want the generator to live on past one session: persisted draw history across devices, an admin screen to manage pools, multi-user raffles, or a proper project you can keep extending.
VM mode spins up a Freestyle sandbox with Vite, React, TypeScript, and Playwright preinstalled. A Claude agent writes the components, runs the dev server, opens the app in a real browser, and tests that Draw, Reset, and history behave correctly. You watch the whole loop stream live.
Frequently asked questions
Why build a random number generator app instead of using an existing one?
Because the existing ones all do the same thing: pick a number between two inputs. Real use cases need more. A raffle needs no-repeats until the pool is drained. A giveaway needs weighted odds. A tabletop session needs 4d6 drop-lowest. A team shuffler needs to split N names into K balanced groups. None of that fits into a generic widget, but all of it fits into a single prompt.
Does mk0r use Math.random() or something cryptographically secure?
By default the generated app uses Math.random(), which is fine for games, raffles, and casual picks. If you need better randomness (for example for a prize draw with real money), add 'use crypto.getRandomValues for randomness' to your prompt and the generated code will use the Web Crypto API instead.
Can I see and edit the generated code?
Yes. Quick mode produces a single standalone HTML file with the JavaScript inline. The random pool is a plain array near the top of the file and the pick function is right below it. You can edit either one in any text editor, or follow up with another prompt like 'change the weight of option 3 to 50 percent' and the AI edits it for you.
How fast is it?
Quick mode streams the app into a live preview as Claude Haiku writes it. Simple RNGs (dice roller, number picker, name drawer) are usually playable in 15 to 30 seconds. More involved ones (bracket drawer with seeds, multi-tier raffle) take under a minute.
Can it remember previous picks to avoid repeats?
Yes. Ask for 'no repeats until the pool is exhausted' or 'remember history in localStorage so refresh does not reset it'. The generated JS will track drawn values and exclude them until you hit a reset button.
Can I use it offline, or host it somewhere?
Quick mode gives you a single HTML file. Download it, open it from your desktop, or upload it to any static host (GitHub Pages, Netlify, an S3 bucket, your Dropbox public folder). It needs no server and no build step.
Does mk0r require an account?
No. Open mk0r.com, type the prompt, get the app. No signup, no email, no payment. That is the whole point.
Need a raffle drawer, weighted picker, or dice roller in the next minute? Build the exact one you need. No signup.
Build Your RNG App