Math Worksheet Generator
Not every project needs a distributed system underneath it to be worth building. Math Worksheet Generator is a small, focused tool aimed squarely at a real, everyday need: teachers and parents who just want a customizable, printable math worksheet in under a minute, without digging through a stock of static PDFs online.
What it does
The whole flow is configuration โ preview โ export, no account or sign-up required:
- Pick one or more operations โ addition, subtraction, multiplication, division
- Set a number range (min/max) to match a student's skill level
- Choose questions per worksheet and how many worksheets to generate at once, so a teacher can hand out several variants to a whole classroom in one pass
- Toggle problem numbering and page numbers
- Add student-info fields (name, date, score), optionally repeated on every page instead of just the first
- Optional watermark and footer link
- Generate a live preview, then print directly or download the batch as PDFs
Why it's useful
Most "free worksheet" sites online are just static libraries โ pre-made PDFs you scroll through hoping one matches what you need. This flips that: instead of searching for the right worksheet, you specify the parameters (operation, number range, quantity) and get exactly that, generated on demand, every time. Batch generation is the detail that matters most for actual classroom use โ a teacher doesn't want one worksheet, they want thirty variants so no two students are copying off each other.
How it's built
The stack is Deno + Hono on the backend, Puppeteer for headless rendering, and pdf-lib for multi-page PDF output โ no frontend framework, just vanilla JS/CSS/HTML. It runs on Cloud Run in Docker, with Firebase Hosting for static assets and GitHub Actions (via Workload Identity Federation, not stored service-account keys) for CI/CD.
A few implementation details worth calling out:
- Shared browser instance โ worksheet generation originally launched a fresh Puppeteer browser per request. Switching to a single shared, reused instance cut generation time by roughly 70%.
- Smart problem generation โ division problems are constructed to avoid remainders, and number ranges are chosen so subtraction stays non-negative, so the output is actually appropriate for a student's level rather than just numerically valid.
- Precise paper-size rendering โ the render viewport is set to exactly 8.5"ร11" at 96 DPI, so the preview is a true what-you-see-is-what-prints match with no scaling surprises.
- Progressive enhancement & accessibility โ the form works with JavaScript disabled, and the UI uses semantic HTML/ARIA so it's usable with a screen reader or keyboard-only.
Notes
This one's closed-source โ the repo is private โ but it's live and free to use at the link above.
Conclusion
Math Worksheet Generator is proof that a project doesn't need to be architecturally ambitious to be worth shipping. It solves one narrow, real problem โ generating the right practice worksheet, fast โ and does it well.
As always, thank you for reading. I really appreciate it. ๐