School Timetable Generator
List each class's lessons with teacher, room and periods per week, mark unavailable slots, press Generate for a timetable with no teacher, class or room clashes, then move and lock lessons by hand and print per class, teacher or room.
Runs in your browser. Your files never leave your device. See how to check
…
How to do it
- 1Set the week
Days and periods per day.
- 2Add lessons
Class, subject, teacher, room and periods.
- 3Mark limits
Unavailable slots per teacher, class or room.
- 4Generate
Get a clash-free timetable.
- 5Adjust and print
Move, lock and print each view.
About this tool
Building a school timetable by hand means juggling three kinds of clash at once: a teacher cannot teach two classes at the same time, a class cannot be in two lessons, and a room cannot hold two groups. This generator handles the juggling for you. Set the number of teaching days and periods per day, then add one row per class and subject with the teacher, the room (or leave it blank if any room will do), how many periods a week the lesson needs and how many it may have on one day; set two per day to allow a double lesson. On the Unavailable tab, tap the slots when a part-time teacher is not in school, when a room is used by another group, or when a class has an assembly. Press Generate and the solver places every lesson period, starting with the hardest to fit, spreading each subject across the week, and retrying many times with different random choices until everything fits. Lessons that cannot be placed are reported so you can add periods or relax a limit. The timetable can be viewed by class, by teacher or by room. Tap a lesson and then another slot to move it; if the slot is taken the two lessons swap, and any clash this creates is listed in red. Lock the lessons you are happy with and generate again to rebuild only the rest. Print one timetable or all of them, or export a CSV for a spreadsheet.
What the generator checks
| Rule | Example | |---|---| | Teacher clash | Ms Khan cannot teach 7A and 7B in period 1 on Monday | | Class clash | 7A cannot have Maths and English at once | | Room clash | The lab holds one group at a time | | Unavailable slots | A part-time teacher's day off | | Daily limit | No more than one English lesson a day |
How it works
Timetabling is a constraint satisfaction problem. The generator expands every lesson into single periods, sorts them so the most constrained (teachers with the most unavailable slots, subjects with the most periods) are placed first, and puts each period in a free slot on the day that has the fewest of that subject so far. If a period cannot be placed, the generator starts again with different random choices, up to thirty times, and keeps the best result.
When not everything fits
Count the demand first: the statistic at the top shows the total lesson periods needed and the slots each class has. If one teacher teaches more periods than there are slots, no timetable can work. Otherwise free up unavailable slots, allow a double lesson, or lock fewer lessons.
Worked example
Two classes, 7A and 7B, each need 5 Maths, 5 English, 3 Science (doubles allowed) and 2 PE periods in a week of 5 days × 6 periods: 15 periods per class in 30 slots. Ms Khan teaches both Maths groups (10 periods) and Mr Lee both English groups (10 periods). The generator places all 30 lesson periods with no clashes, and no class has English twice on one day.
Privacy
Your timetable is saved only in this browser. Export the project to share it with colleagues.
Limits
Suitable for small and medium schools and departments. It does not handle split classes, rotating weeks or teacher preferences beyond unavailable slots; it is not a replacement for official school management software.
Worked example
2 classes × 15 periods in a 5 × 6 week → all 30 placed, no teacher, class or room clashes.
Quick facts
- Category: Study & Education
- Works in your browser, no sign-up, no upload.
- Your input stays on your device.
- Available in English.
- Content last reviewed:
- Official source: School timetabling as a constraint satisfaction problem
Frequently asked questions
Will the timetable always have no clashes?
Generated timetables never have clashes; manual moves can create them, and they are listed in red.
Can I have double lessons?
Yes, set Max per day to 2 for that lesson.
Can I keep part of a timetable?
Yes, lock lessons with the padlock and generate again.
Can teachers see their own timetable?
Yes, switch the view to Teacher and print it.
What if some lessons cannot be placed?
The tool tells you how many; add periods, relax limits or free unavailable slots.
Can I use it in Excel?
Export the CSV and open it in any spreadsheet.
