Skip to content

Balaji-P-A/javascript-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

HTML5 CSS3 JavaScript Status License

JavaScript Calculator (Basic + Scientific)

A simple and fully working JavaScript calculator made using HTML, CSS, and JavaScript.
It includes both basic arithmetic functions and scientific functions.

Live Demo

JavaScript Calculator - Live Demo Screenshot 2025-11-25 181406

Features

Basic Calculator

  • Addition (+)
  • Subtraction (-)
  • Multiplication (×)
  • Division (÷)
  • Percentage (%)
  • Backspace and Clear
  • Keyboard input support

Scientific Calculator

  • Square Root (sqrt)
  • Power (x^y)
  • sin(x)
  • cos(x)
  • tan(x)
  • Natural Log (ln)
  • Log base 10 (log)

UI and Extra Features

  • Clean and modern design
  • Shows both expression and result
  • History of calculations with timestamps
  • Scientific panel toggle button
  • Responsive layout for different screen sizes

Project Structure

calculator.html # Contains HTML, CSS, and JavaScript in a single file

Technologies and Skills Demonstrated

Core Skills

  • JavaScript (ES6): events, functions, expression evaluation, DOM manipulation
  • HTML5: clean structure
  • CSS3: layout, styling, responsive design
  • Debugging and problem-solving
  • Basic UI/UX design

Technologies Used

  • HTML5
  • CSS3
  • JavaScript (ES6)

How It Works

  • The calculator reads the expression as text
  • Safely evaluates the expression through controlled JavaScript functions
  • Scientific operations use the built-in Math library
  • History is stored during the browser session

Future Improvements

  • Dark/Light mode switch
  • Move CSS and JS into external files
  • Add memory functions (M+, M-, MR)
  • Add degrees/radians toggle for scientific functions

License

This project is open-source and free to use or modify.

Author

Balaji P

About

Basic + Scientific JavaScript Calculator

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages