Loot Table Roller
Weighted random picker for loot tables, names or any custom list.
Overview
The Loot Table Roller is a weighted random picker for any list of items with associated probabilities. Paste a table of names and weights — loot drops, NPC names, encounter triggers, random pizza toppings — and it rolls one or many results according to the weights. Use it for tabletop game prep, generative content seeds, or any project that needs reproducible weighted choice.
Weights can be any non-negative numbers; they don't need to sum to 100. An entry with weight 1 against three entries with weight 4 each will appear about 1/(1+4+4+4) = 7.7 percent of the time. The roller copes with hundreds of entries and supports rolling several picks at once, useful for "roll 1d6 loot drops" style generation.
How it works
The picker uses cumulative-weight sampling. After normalising weights to a total, it computes a prefix sum so that the i-th entry occupies the interval [sum_before_i, sum_before_i + weight_i) on the number line. A uniform random sample of that total is taken and binary-searched into the prefix sum to find the chosen entry.
For multi-pick rolls, each pick is independent — the same entry can be drawn twice in a single roll. If you need draws without replacement, the picker can also be configured to remove a picked entry from the pool, which scales the remaining weights up so the total still sums to one.
Examples
- Three entries
Common 70,Rare 25,Legendary 5: a single roll gives the common item about 70 percent of the time, rare 25 percent, and legendary 5 percent. - 100-row name table with equal weights: each name is picked with probability 1 percent per roll.
- D&D treasure table: 2d6 picks against a 20-entry weighted list builds a varied hoard quickly.
- A "rare-spawn" simulator with weights 999/1 returns the rare entry roughly once every thousand rolls.
FAQ
Do the weights need to be integers?
No — any non-negative numbers work. Floats and integers can be mixed.
Can the same entry be rolled twice in one batch?
Yes by default. Enable without-replacement mode to forbid duplicates within a batch.
What's the maximum table size?
Several thousand entries roll in milliseconds. Truly massive tables (100K+) may take a noticeable moment.
Are zero-weight entries ever picked?
No. A weight of zero means the entry is excluded from sampling.
How is randomness generated?
A standard JavaScript PRNG seeded from the browser's secure random. Cryptographically strong RNG isn't necessary for loot rolling.