Free automatic school timetable generator

Building a timetable by hand is an enormous puzzle: every teacher, every class and every room can only occupy one slot at a time, while satisfying dozens of constraints that all interact with each other. This generator automates that work using a constraint-programming solver — the same kind of mathematical engine used for industrial scheduling — in anywhere from a few seconds to a few dozen, depending on the size of the school.

How automatic generation works

You describe your school in five steps: the timetable grid (working days, number of periods per day, breaks), classes and subjects with their weekly hour requirements, teachers (which subjects they can teach, slots when they're unavailable, a maximum number of hours per day), specialised rooms if your school has any (a lab, a computer room...), and finally optional preference sliders. The calculation then runs on our servers: unlike a spreadsheet or an algorithm that works slot by slot, the solver explores the space of possible combinations mathematically completely, guaranteeing that no resource is ever double-booked.

Two kinds of rules coexist. Hard constraints are never negotiable: a teacher can't be in two places at once, a course can't exceed its declared weekly hours, a specialised room can only host one course at a time. Soft preferences, adjustable with sliders, steer the result without ever blocking it: spreading a subject's sessions across several days rather than bunching them together, or limiting the gaps in a teacher's day between two classes on the same day. The solver always looks for the solution that satisfies every hard constraint and best satisfies the weighted preferences — never the other way round.

Why some timetables are impossible

A timetable can be mathematically infeasible, and that's not a bug in the tool: it's often the school itself asking for the impossible without realising it. The most common case is a teacher whose required hours exceed their declared availability — the tool detects this in a few milliseconds with a simple arithmetic check and names the problem explicitly ("Mr. Adams must teach 26 hours but is only available for 22"), without even needing to run the full solver.

Other infeasibilities are more subtle: too many courses needing the same specialised room at the same time, or a build-up of small constraints that each look harmless on their own but together leave no valid combination. In these rarer cases, the tool methodically relaxes groups of hard constraints until it identifies the minimal set responsible for the infeasibility, and translates that into a readable sentence rather than simply reporting a failure.

Tips for entering availability

The quality of the result depends directly on how precisely availability is entered. A few principles avoid unpleasant surprises: only tick an unavailability if it's real and recurring (a part-time teacher, a day off) — a box ticked out of excessive caution can be enough to make the whole timetable infeasible when a little more room to manoeuvre would have been enough. Conversely, a teacher left available everywhere by default gives the solver maximum flexibility: that's actually the tool's default behaviour, a checkbox only adds a constraint once you explicitly tick it.

Also think about keeping total weekly hours reasonable relative to the number of slots available in the week: asking a teacher to cover more hours than there are slots in their working week makes the problem infeasible before even considering the other teachers. If you're trying the tool for the first time, start with a small subset of classes and subjects to get familiar with the input, then expand gradually.

Results and adjustments

Once generation is complete, the timetable can be viewed from three complementary angles: by class (for display to students), by teacher (for individual handouts) and by room (to check how shared spaces are used). Any slot can be dragged to a new position by hand if a last-minute adjustment is needed; the tool immediately re-checks for potential conflicts, never recalculating everything from scratch.

The final timetable can be exported as a PDF (one page per class and per teacher, ready to print or display), as Excel (for your own further processing), and in iCalendar format (to import each teacher's schedule into their usual calendar app). The whole project — grid, classes, teachers, constraints — can also be exported as JSON to pick up later or share with a colleague using the same tool.

Frequently asked questions

How long does it take to generate a timetable?
For a small school (a handful of classes), the optimal solution is usually found in a few seconds. For a full secondary school (around twenty classes, thirty teachers), expect anywhere from a few seconds to about thirty, depending on how tight the constraints are — solving is capped at 45 seconds, after which the best result found so far is returned.
Why does the tool say my timetable is impossible?
The solver explains the most likely cause in one sentence, naming the resource involved — for example "Mr. Adams must teach 26 hours but is only available for 22". The most common case is a teacher overcommitted relative to their declared availability, followed by too few specialised rooms and overloaded time slots.
What if the diagnosis doesn't point to an obvious cause?
Some infeasibilities come from several small constraints combining rather than one dominant cause (a "bin-packing" problem: too many courses to fit into too few compatible slots). In that case, start by loosening the most restrictive availabilities or adding more slots, then regenerate.
Are "preference" constraints always honoured?
No, and that's intentional: spreading a subject's sessions across the week, or minimizing gaps in a teacher's day, are weighted preferences, never hard rules. The solver never gives up on finding a feasible schedule because of a preference — it simply sets that preference aside rather than declaring the whole thing infeasible.
Can I adjust the generated timetable by hand?
Yes: any course can be dragged to a different slot in the grid. Every move is re-checked instantly (the same teacher double-booked, a missing specialised room...) and any conflicts show up immediately, with no need to rerun the whole calculation.
How do I import my classes, subjects and teachers without retyping everything?
Download the Excel template from the wizard, fill in the Classes, Subjects, Teachers, Rooms and Courses sheets, then import the file: the wizard's fields fill in automatically. A partial CSV import (one table at a time) is also supported.
Is my data (teacher names, class names) kept anywhere?
No: the project is saved only in your browser (local storage), never on our servers. The calculation itself runs server-side for the duration of the solve, then the submitted data is discarded — you can export your project as JSON to back it up yourself or pick it up on another device.
Is there a limit on the number of classes or teachers?
Yes, to keep solving times reasonable: 30 classes and 60 teachers maximum, which comfortably covers a full secondary school. Beyond that, the tool shows a clear message instead of a calculation that would silently fail.