A clean, responsive calculator built with HTML, CSS, and vanilla JavaScript.
- Basic operations — addition, subtraction, multiplication, division, modulus
- Decimal support
- Chained calculations (e.g. 5 + 3 × 2)
- Keyboard support (type numbers and operators directly)
- Backspace key to delete last digit
- Error handling for division by zero
- Responsive design
| Key | Action |
|---|---|
0–9 |
Number input |
+ - * / |
Operators |
Enter or = |
Calculate |
Backspace |
Delete last digit |
Escape |
Clear all |
- HTML5
- CSS3 (Grid layout, CSS transitions)
- Vanilla JavaScript (DOM manipulation, event listeners)
- DOM manipulation with
querySelectorandquerySelectorAll - Handling user events with
addEventListener - Managing application state with variables
- Keyboard event handling with
keydown - Floating point precision with
toFixed()
- Clone the repo
git clone https://github.com/sumiran3031/calculator.git - Open
index.htmlin your browser — no setup needed!
Made by Sumiran Paparkar