Math Calculator

A scientific calculator with expression editing, memory, and history. Everything runs in your browser — your history is saved only on this device.

0

About this tool

This is a full scientific calculator built to handle real expressions, not just single button presses. You can type or tap out something like 2(3+4)^2 or sin(30)+sqrt(16) as one continuous expression, edit it in place, and see a live preview of the result before you commit — rather than the traditional four-function calculator model where every operation has to be entered one step at a time with no way to review what you typed. It supports the standard trig functions in both degrees and radians (toggle with the RAD/DEG button), logarithms, square roots, factorials, percentages, and the constants π and e, alongside normal arithmetic with correct operator precedence.

Under the hood, this isn't running your input through JavaScript's eval() — that would be both a security risk and mathematically wrong for things like implicit multiplication (2(3+4) or without an explicit ×). Instead, it's a proper hand-written tokenizer and recursive-descent parser that builds an actual expression tree before evaluating it, the same general approach a real calculator or programming language uses under the hood. That's also what makes memory functions (M+, M−, MR, MC) and calculation history work reliably against arbitrarily complex expressions rather than just the last single number entered.

History and memory are saved to your browser's local storage so they persist between visits, but that data never leaves your device — there's no account, no sync, and no server involved anywhere. Clicking any entry in the history panel loads that expression back into the display so you can tweak and recalculate it.