Random Partition Generator
Splitting a hundred into five random parts sounds trivial until you try it. Draw five random numbers and they will not add to a hundred; scale them and you get fractions; round the fractions and you are back to ninety-nine or a hundred and one. The parts have to be constructed rather than corrected, and this constructs them: cut points chosen between the units, so the pieces sum to the total exactly and every possible split is equally likely.
What this generator does
Produces random parts that are guaranteed to sum to the total. The bill splitter already here divides an amount as evenly as whole pennies allow; this does the opposite, producing a deliberately uneven split with the same exactness guarantee. Both exist because 'the parts must add back up' is the hard requirement in either direction.
How to use this tool
- Enter the total to split.
- Choose how many parts.
- Decide whether a part may be zero.
- Press Split it, adding labels if you want the parts named.
Understanding the controls
- Total to split
- A whole number — points, minutes, sweets, budget units. Everything else is derived from it.
- How many parts
- Cannot exceed the total when every part must be positive, because there is no way to give five people a positive share of three.
- Can a part be zero?
- A genuinely different question. 'Share ten sweets between four children, somebody may get none' is not the same distribution as 'everyone gets at least one', and the tool asks rather than guessing.
- Labels
- Optional names for the parts, so the output reads as an allocation rather than a list of numbers.
Worked examples
- 100 into 5 parts
- Something like 31, 8, 24, 2, 35 — always summing to exactly 100.
- 5 into 5 parts
- 1, 1, 1, 1, 1 — the only possible split when every part must be positive.
- 10 into 4, zeros allowed
- 0, 6, 1, 3 is a legitimate outcome, and a common one.
- What is never shown
- Parts that sum to 99 or 101.
Common use cases
- Dividing points, budget or minutes between people or tasks at random
- Generating uneven test data that still sums to a known total
- Setting a random starting distribution for a game
- Sharing out a prize pot where the amounts should differ
- Demonstrating that a random split is rarely close to even
How this generator works
The construction is stars and bars. To split a total into k positive parts, choose k−1 distinct cut points from the gaps between units and take the distances between them; the parts sum to the total by construction rather than by any correction afterwards, and every composition is equally likely. Allowing zero-sized parts uses the standard bijection: partition the total plus k into positive parts and subtract one from each. Neither route can produce a set that fails to add up, which is the property the whole tool exists for.
Randomness and fairness
The cut points are drawn with the browser's cryptographic random number generator, and every composition of the total is equally likely as a result. A seed switches to a documented generator that is deterministic, not cryptographic, so the same split can be produced again. The summing property is not random at all: it holds by construction, for every split.
For how randomness is produced across the whole site, see how Generate Random works.
Assumptions this tool makes
- Every composition of the total should be equally likely, which is what 'random split' normally means.
Limitations and good to know
- Whole numbers only. Splitting money to the penny is what the bill split calculator is for.
- It produces a uniformly random split, which is usually very uneven. If you want parts that are close to equal, this is the wrong tool.
- There is no way to constrain individual parts to a range.
Common mistakes
- Expecting the parts to look roughly equal
- A uniformly random split is lumpy — one part is often several times another. That is what random means here, and evening it out would make the distribution something else entirely.
- Scaling random numbers to reach a total
- That is the approach this exists to replace. Scaling produces fractions, rounding them breaks the total, and correcting the remainder biases whichever part you correct.
Practical tips
- Allow zero parts when the real situation permits somebody getting nothing; forbidding it quietly changes the odds for everyone else.
- Add labels to turn the output into an allocation you can act on directly.
Privacy and your data
Only numbers and optional labels are entered, and none of it leaves your browser. Nothing is uploaded, stored, or written into the page address.
Frequently asked questions
- Why can't I split 3 into 5 positive parts?
- Because there is no such split — five positive whole numbers are at least five. Allow zero-sized parts and it becomes possible, and the tool will do it.
- Is every split equally likely?
- Yes, and that is the point of the stars-and-bars construction. Every composition of the total into that many parts has the same chance, which is not true of the obvious approaches.
Related generators
- Bill Split CalculatorSplits a bill so the shares add back up to it exactly, and decides fairly who takes the penny that will not divide.
- Weighted Draw SimulatorDraws from options with different weights, and shows what you got beside what the weights predicted.
- Random Team GeneratorSplit a list of names into a chosen number of random, evenly sized teams.