Draw math with your mouse. Get the answer instantly.
DrawCalc is a handwriting calculator that uses AI to recognize math expressions drawn on a canvas and evaluate them in real time — no keyboard needed.
- 🖊️ Draw math expressions with your mouse (e.g.
15 + 5,3 × 4,10 / 2) - 🤖 AI-powered recognition via Google Gemini
- 🌙 Light / Dark mode
- ⚡ Instant results
- 🔒 Secure by design
git clone https://github.com/zaydkassimi/DrawCalc.git
cd DrawCalcnpm installcp .env.example .env.localThen open .env.local and add your API key:
GEMINI_API_KEY=your_key_here
Get a free key at aistudio.google.com
npm run dev| Variable | Description | Required |
|---|---|---|
GEMINI_API_KEY |
Google Gemini API key | ✅ Yes |
| Feature | Status |
|---|---|
.env.local gitignored |
✅ |
| Rate limiting (10 req/min per IP) | ✅ |
| Input validation & 5MB limit | ✅ |
| Security headers (XSS, CSP, X-Frame) | ✅ |
| No stack traces exposed to client | ✅ |
- User draws a math expression on the canvas
- Canvas is captured as a PNG image
- Image is sent to Google Gemini Vision API
- Gemini reads the handwriting and evaluates the math
- Result is displayed instantly
- Next.js 14 — App Router
- TypeScript
- Tailwind CSS
- Google Gemini AI
- HTML5 Canvas API
MIT — feel free to use and modify.
Made with ☕ by Zayd Kassimi