A lightweight, modern web-based calculator built with HTML, CSS, and JavaScript. Perform basic arithmetic operations with an intuitive user interface.
- ✨ Basic Operations: Addition, subtraction, multiplication, and division
- 🎨 Modern UI: Clean, responsive design with a gradient background
- 💾 Decimal Support: Handle decimal calculations with precision
- ➕ Sign Toggle: Easily switch numbers between positive and negative
- 🔄 Clear Function: Reset calculator with a single click
⚠️ Error Handling: Division by zero protection- 📱 Responsive Design: Works seamlessly on desktop and mobile devices
- Clone the repository:
git clone https://github.com/codiing-5/calculator.git
cd calculator- Open
calculator.htmlin your web browser
That's it! The calculator is ready to use.
- Number Buttons (0-9): Click to input numbers
- Operators (+, −, ×, ÷): Select an operation
- Decimal Point (.): Add decimal values
- Sign Toggle (±): Make numbers positive or negative
- Equals (=): Calculate the result
- Clear (C): Reset the calculator
- HTML5: Structure and markup
- CSS3: Styling, animations, and responsive layout
- JavaScript: Calculator logic and interactivity
calculator/
├── calculator.html # Main application file (HTML, CSS, and JavaScript)
└── README.md # Documentation
7 + 3=1015 − 5=106 × 4=2420 ÷ 4=5
Works with all modern browsers including:
- Chrome
- Firefox
- Safari
- Edge
- Advanced operations (square root, percentage, exponents)
- Calculation history
- Keyboard support
- Dark mode theme
- Additional number formats
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Feel free to fork this repository and submit a pull request with your improvements.
Created by: codiing-5
Last Updated: 2026-04-07