A simple web-based chatbot that evaluates math expressions in real-time.
Built with HTML, CSS, and JavaScript, using math.js for expression parsing and evaluation.
🌐 Live View
- Enter any math expression (e.g.,
2+2
,sqrt(16)
,(5*3)/2
). - Automatically evaluates and returns the result.
- Supports Enter key to submit (just like pressing "Send").
- Handles invalid inputs with user-friendly error messages.
- Auto-scrolls the chat so the latest message is always visible.
- HTML5 – structure
- CSS3 – styling
- JavaScript (Vanilla) – logic
- Math.js – math expression evaluation
├── index.html # Main HTML file
├── styles.css # Styles for the chat UI
├── script.js # JavaScript logic (chat + math evaluation)
└── README.md # Project documentation
-
Clone this repository:
git clone https://github.com/Rakshitgupta9/MathBot.git
-
Navigate into the project folder:
cd math-bot
-
Open
index.html
in your browser.
-
Input:
5 * (2 + 3)
-
Output:
25
- Add support for multiline inputs (
Shift + Enter
for new line). - Improve styling with animations.
- Add history persistence (local storage).
- Support for more advanced math (graphs, matrices, etc.).
🔗 Built By - My Portfolio using JavaScript and math.js.