GenerateRandomSearch

Shift Rota Generator

A duty rota where everybody takes every job once is a Latin square, and this site has had one for a while. A staffing rota is a different problem: shifts need a set number of people on them, some people cannot work some days, nobody should work two shifts back to back, and the nights need sharing out rather than landing on whoever is easiest to ask. Those are hard constraints, and a rota that quietly breaks one is worse than a rota with a visible gap in it.

What this generator does

Solves the staffing problem rather than the rotation problem. The duty rota generator here guarantees everybody takes every duty once, which is right when the jobs are interchangeable. This guarantees something different and harder: every shift gets the number of people it needs, nobody is scheduled when they said they could not work, nobody works closer together than the rest gap allows, and the shifts nobody wants are shared out rather than concentrated. Where those cannot all hold, the gap is shown.

How to use this tool

  1. List everybody, adding days they cannot work after a colon.
  2. List the shifts as “Name, how many people”.
  3. Set the number of days and the rest gap between shifts.
  4. Build it — any slot that could not be filled is shown as short rather than filled wrongly.

Understanding the controls

People and their days off
One per line. Add unavailable days after a colon, so “Ada: 3, 4” means Ada cannot work days three or four. Nobody is ever scheduled on a day they have blocked.
Shifts and cover
One per line as “Name, number”. The number is how many people that shift needs every day it runs. A shift named Night, Weekend or On-call is highlighted in the fairness summary.
Days
How long the rota runs. The page shows how many shift slots that adds up to, which is the number your team has to cover.
Clear days between shifts
Zero allows consecutive days. One means a clear day off in between. This is the constraint that makes the problem genuinely hard, and the one a hand-built rota breaks first.

Worked examples

8 people, 5 slots a day, 14 days
Every slot filled, totals level to within one.
A night shift over 12 days
Nights differ by at most one across the team.
4 people, 4 slots a day, one clear day between
Impossible from day two — the gaps are shown and explained.
Somebody unavailable all fortnight
Never scheduled, and the others absorb the cover.

Common use cases

  • Building a two-week rota for a small team with a night shift
  • Scheduling weekend cover where nobody should do two in a row
  • Producing a fair rota when several people have fixed commitments
  • Checking whether a rota is even staffable before promising it
  • Rebuilding a rota quickly after somebody drops out

How this generator works

Slots are filled one at a time from whoever is eligible — available that day, rested enough, and not already working. Among those, the person who has had fewest of *that particular shift* goes first, which is what spreads the nights out; sorting on the overall total instead leaves one person with every one of them. Where no eligible person exists the slot is left visibly unfilled rather than filled by breaking a rule. The finished rota is then re-read: nobody on two shifts in a day, nobody working a blocked day, every rest gap honoured, and the per-person totals matching the assignments.

Randomness and fairness

Randomness breaks ties between people who are equally behind on a shift type, and decides the order candidates are considered. Everything else is a consequence of the constraints, so pressing again gives a different rota with the same guarantees rather than a better or worse one.

For how randomness is produced across the whole site, see how Generate Random works.

Assumptions this tool makes

  • Anybody can work any shift, and everybody not marked unavailable is available.
  • One shift per person per day.

Limitations and good to know

  • This is not working-time law. Rest gaps are whatever you set them to, and the tool knows nothing about your jurisdiction, contracts or agreements.
  • It has no concept of skills or qualifications — anybody can fill any shift, which is often not true.
  • Shifts are whole days. Overlapping shifts, part-days and handovers are not modelled.
  • Fairness is measured per shift type and overall; it cannot know that one person prefers nights.
  • Nothing is saved between visits — copy the rota before you close the page.

Common mistakes

Setting a rest gap the team size cannot support
With a one-day gap, at most half your people are available on any given day. The page shows the slots needed against the people you have.
Reading an unfilled slot as a bug
It is a staffing gap made visible. Filling it would have meant scheduling somebody unavailable or under-rested, which is the failure this tool exists to avoid.
Checking only the totals for fairness
Everybody can work ten shifts while one person works every night. The per-shift spread is the number that matters.

Practical tips

  • Collect unavailability before building rather than fixing the rota afterwards.
  • Build a couple and compare the fairness lines — they differ, and one is usually noticeably better.
  • If slots keep coming up short, the honest fix is more people or less cover, not a different rota.

Privacy and your data

The names, availability and shift patterns you type stay in your browser. Nothing is uploaded, nothing is stored between visits, and none of it is written into the page address — which matters, because a rota is staff data. Analytics records that the tool ran and how many assignments it made, never a name.

Frequently asked questions

How is this different from the duty rota generator?
That one rotates people through interchangeable duties so everybody does each once. This one covers shifts that need a set number of people, respects days off and rest gaps, and spreads the unpopular shifts. Different guarantee, different problem.
Why are some slots empty?
Because no eligible person was left — everyone was either unavailable, already working, or too recently on. That is a staffing gap, and showing it is more useful than quietly double-booking somebody.
Is the rota legally compliant?
It cannot be, because it does not know your jurisdiction or your contracts. It applies the rest gap you set and nothing more. Check the result against your own rules.
How is fairness measured?
As a spread, per shift type as well as overall. If everybody has the same total but one person has every night, the night spread shows it and the total does not.