A calculator and equation solver with 37 tools, worked solutions, six languages and offline support.
Features • Getting Started • Usage • Project Structure • Testing • Contributing
EquaSolver is a web calculator for equations, calculus, statistics, graphs and everyday conversions. It is built with vanilla JavaScript, HTML and CSS: no framework, no build step, no runtime dependency except jsPDF for PDF export. It installs as a PWA and keeps working offline.
The interface is light by default and follows the system dark mode, with one accent colour per theme, a serif display face, tabular figures for numbers, and motion that only conveys state.
| Tool | What it does |
|---|---|
| Standard calculator | Arithmetic and scientific keys (sin, cos, tan, √, ln, log, eˣ, n!, π, e, x²), degrees / radians switch, memory keys (MC, MR, M+, M−), floating point noise removed from results, Ctrl+Z / Ctrl+Y undo and redo |
| Expression calculator | Type a whole expression such as 2 + 3 * (4 - 1)^2, sqrt(2) * pi, 5! / 3!; ans is the previous result; insert keys for functions; reusable history of the last results |
| Percentage | Percent of a value, change between two values, increase and decrease |
| Ratio & proportion | Simplifies ratios (decimals included) and solves a : b = c : x |
| Fractions | Simplify, add, subtract, multiply, divide, mixed numbers, decimal value |
- Linear, quadratic, cubic, quartic and quintic equations with real and complex roots shown as
a ± bi. Multiple roots are recognised as real roots, and quadratic roots keep full precision when the coefficients differ greatly in size. - Exact form of quadratic roots: fractions (
1, 1/2), radicals ((3 ± √5) / 2) and complex values (-1 ± 2i) next to the decimal results. - Systems of linear equations: 2×2 and 3×3 with Cramer's rule, and n × n (2 to 5) with Gaussian elimination and partial pivoting, including every row operation as a foldable list of matrices. Detects unique, infinite and impossible systems.
- Inequalities: linear, quadratic and absolute value, with interval notation.
- Absolute value equations
|ax + b| = c. - Trigonometric equations
sin x = k,cos x = k,tan x = kon a chosen domain. - Exponential and logarithmic equations:
aˣ = b,a·bˣ = c,eˣ = a,log_a(x) = b,log_a(bx + c) = d,ln x = a,log x = a, with steps. - LaTeX input: type an equation such as
x^2 - 5x + 6 = 0with live preview; terms that cancel are handled. - Polynomial division with quotient and remainder, plus the factored form of the dividend over the rationals (
(x - 1)(x - 2)(x - 3)). - Partial fraction decomposition of
P(x) / Q(x)in exact fractions, with polynomial part and repeated factors.
- Matrices (2×2 and 3×3): addition, multiplication, determinant, inverse, transpose, trace, rank and eigenvalues (real or complex).
- GCD and LCM of several numbers with prime factorisations.
- Prime numbers: primality test (exact up to 2⁵³ with Miller-Rabin), next and previous prime, list of all primes up to 5 000 000.
- Modular arithmetic: modulo, modular inverse and exponentiation with exact big-number products.
- Combinatorics: factorial, permutations, combinations (no overflow for large n).
- Base converter: binary, octal, decimal, hexadecimal.
- Unit converter: length, mass, temperature, time, area, volume, speed, energy, pressure and digital storage (SI and binary prefixes), with a swap key.
- Derivatives: symbolic, at a point, nth order and critical points.
- Integrals: symbolic indefinite integrals and definite integrals (Simpson's rule).
- Limits computed numerically from the left, the right or both sides, including limits at ±∞ and removable singularities such as
sin(x)/x. - Taylor series of sin, cos, eˣ, ln(1 + x) and arctan.
- Numerical integration: trapezoidal and Simpson's rules.
- Sequences: arithmetic, geometric and Fibonacci, with sums and formulas.
- Descriptive statistics: mean, median, mode, variance, standard deviation, minimum, quartiles, interquartile range, outliers (Tukey fences) and a histogram.
- Linear regression: fitted line, slope, intercept, r, R², prediction for any x, and a scatter plot with the fitted line.
- Function plotter: up to four
y = f(x)curves on one canvas. Drag to pan, scroll or pinch to zoom, hover to read values, double-click to reset. Roots, extrema and intersections are detected and listed; curves draw themselves; export to PNG. - 3D surface:
z = f(x, y)with presets, rotate by dragging or with the arrow keys, zoom, height colouring, rise animation. - Cartesian graph of linear, quadratic and cubic equations, parametric curves (circle, ellipse, spiral, Lissajous) and polar curves (cardioid, roses, spiral, lemniscate).
- Shareable links: the Share button copies a link that reopens the tool with its current values and runs it.
#quadraticstyle links also open a tool directly, and the PWA shortcuts use them. - Copy result button under every solution.
- History of the last 50 calculations, with favorites that survive clearing.
- PDF export of solutions, graphs and plots (symbols that jsPDF cannot print are transliterated).
- Print stylesheet: only the open tool and its solution are printed.
- Tool search on the home screen, accent and case insensitive.
- Light, dark or system: follows
prefers-color-schemeuntil you choose, with no flash on load. - Six accent themes (Cobalt, Graphite, Emerald, Vermilion, Teal, Violet) plus a custom theme builder. Theme and mode changes cross-fade.
- Six languages: English, French, Spanish, German, Italian, Russian. A test keeps every language in sync.
- Decimal comma accepted in numeric fields.
- Keyboard: digits and operators drive the calculator,
Enteror=calculates,Escapeclears,Backspacedeletes, arrow keys rotate the 3D surface, the settings panel traps focus and closes withEscape. - Responsive layout and reduced-motion support.
- Progressive Web App: installable, precached by a service worker, works offline.
- Safe by design: expressions are parsed by a recursive-descent parser, never evaluated as JavaScript, and user text is escaped before it is shown.
- A recent browser. Current Chrome, Edge, Safari and Firefox give the full experience (view transitions, scroll-driven animation, relative colours); older browsers keep working, without the animation.
- Node.js only if you want to run the tests.
git clone https://github.com/l-at-nnes/EquaSolver.git
cd EquaSolverOpen index.html (it redirects to src/index.html), or serve the folder:
npx serve .
# or
python -m http.server 8000 --directory srcThere is no build process. The service worker needs http://localhost or HTTPS to register.
- Pick a tool on the home screen (or type in the search box), or open
index.html#plotterdirectly. - Fill the inputs; the equation preview updates as you type.
- Press Solve / Calculate. Worked steps appear under the result.
- Use Copy result, Export PDF, Share or print.
| Tool | Input | Result |
|---|---|---|
| Quadratic | a = 1, b = -3, c = 1 | x ≈ 2.618, 0.382; exact form (3 ± √5) / 2 |
| Expression | 2 + 3 * (4 - 1)^2 |
29 |
| Limit | sin(x)/x at 0 |
1 |
| Polynomial division | x^3 - 6x^2 + 11x - 6 ÷ x - 1 |
quotient x² - 5x + 6, factored (x - 1)(x - 2)(x - 3) |
| Partial fractions | 3x + 5 over x^2 - x - 6 |
1/(5(x + 2)) + 14/(5(x - 3)) |
| Plotter | sin(x) and x^2 / 4 - 1 |
curves with their intersections marked |
| Regression | 1 2, 2 4, 3 5, 4 4, 5 5 |
y = 0.6x + 2.2, R² = 0.6 |
| Key | Action |
|---|---|
0-9, ., + - * / |
Calculator input (standard calculator open) |
Enter, = |
Calculate |
Backspace |
Delete the last digit |
Escape |
Clear the calculator / close the settings panel |
Ctrl/Cmd + Z, Ctrl/Cmd + Y |
Undo, redo |
Arrow keys |
Rotate the 3D surface when the canvas has focus |
EquaSolver/
|-- index.html # Redirect to src/index.html
|-- src/
| |-- index.html # The application
| |-- manifest.json, sw.js # PWA manifest and service worker
| |-- assets/ # Icons
| |-- css/
| | |-- base.css # Layers, design tokens, themes, shared controls
| | |-- home.css # Hero and tool tiles
| | |-- calculator.css # Tabs, keypad, history, expression calculator
| | |-- forms.css # Inputs, matrices, unit swap
| | |-- results.css # Solutions, steps, histogram, Gauss steps
| | |-- plotter.css # Plotter, 3D surface, regression
| | |-- settings.css # Settings panel and theme swatches
| | |-- print.css # Print stylesheet
| |-- js/
| |-- script.js # Application entry point (browser)
| |-- index.js # CommonJS entry point for the tests
| |-- math/ # complex, matrix, linear-system, gcd-lcm, primes, modular,
| | # combinatorics, fractions, exact, statistics, regression, sequences
| |-- solvers/ # inequality, absolute, trigonometric, exponential-log,
| | # polynomial-division, factor, partial-fractions
| |-- calculus/ # derivatives-integrals, limits, taylor, numerical-integration
| |-- converters/ # base, units
| |-- parsers/ # expression (safe parser), latex
| |-- graphing/ # cartesian, parametric, polar, plotter, surface
| |-- ui/ # calculator, expression-calc, history, themes, export, clipboard,
| | # router, search, motion, inputs, system-n, regression, animations, ...
| |-- i18n/ # en, fr, es, de, it, ru
|-- tests/
| |-- unit/ # Jest, 57 suites
| |-- e2e/ # Playwright spec
| |-- manual/test.html # In-browser checks
|-- docs/ # API.md, TESTING.md
|-- TODO.md # Roadmap
|-- PRODUCT.md, DESIGN.md # Product and design notes
- HTML5, CSS3, vanilla JavaScript; Canvas 2D for every plot, including the 3D surface (software projection and painter's algorithm).
- CSS: cascade layers,
@propertyregistered colours (theme changes interpolate),light-dark(), OKLCH with relative colour syntax, container queries,:has(), view transitions, scroll-driven animation, native nesting. - jsPDF for PDF export (loaded from a CDN, cached by the service worker).
- No framework, no bundler, no web font: system font stacks only.
npm install
npm test # all unit tests
npm run test:watch
npm run test:coverage1411 tests in 57 suites cover:
- the mathematics: every solver, the parser, calculus, statistics, matrices, primes, conversions, factoring and partial fractions;
- the interface logic: calculator state machine, history and favorites, themes and settings, routing and share links, search, clipboard, PDF export, graph drawing;
- a smoke test that loads the real
index.htmlwith every script in jsdom and presses all the solve buttons; - translation parity: every language has the same keys and every key used by the page exists;
- the service worker precache list and the print stylesheet.
The Playwright spec in tests/e2e/ needs @playwright/test, which is not a dependency of the project. tests/manual/test.html runs checks in a real browser.
See docs/TESTING.md for details and docs/API.md for the function reference.
| Problem | Method |
|---|---|
| Quadratic | Discriminant, with the numerically stable form of the quadratic formula; exact form from integer discriminant and square-free part |
| Cubic | Cardano with tolerances relative to the size of the roots, trigonometric form for three real roots |
| Quartic, quintic | Durand-Kerner iteration; tight clusters of roots are averaged so multiple roots come out real |
| Linear systems | Cramer's rule (2×2, 3×3); Gaussian elimination with partial pivoting (n × n) |
| Eigenvalues | Characteristic polynomial (trace, sum of principal minors, determinant) |
| Factoring | Rational root theorem with exact integer arithmetic and multiplicities |
| Partial fractions | Basis terms per factor power, solved as an exact rational linear system (BigInt) |
| Limits | One-sided sampling toward the point with Richardson extrapolation; divergence and oscillation detection |
| Roots and extrema on plots | Sign changes refined by bisection; poles rejected by checking the value at the converged point |
| Primality | Deterministic Miller-Rabin for all safe integers |
| Regression | Ordinary least squares on centred data |
| Expressions | Recursive-descent parser: unary minus, right-associative powers, implicit multiplication, constants and functions |
Contributions are welcome. Read CONTRIBUTING.md first.
- Fork the repository and create a branch (
git checkout -b feature/YourFeature). - Add tests with your change and run
npm test. - Keep translations in sync: add keys to all six files in
src/js/i18n/(a test enforces it). - If you add a script or stylesheet, list it in
src/index.html, in the precache list ofsrc/sw.jsand bump the cache version. - Open a pull request.
Ideas are tracked in TODO.md.
MIT. See LICENSE.
Built with precision and attention to detail
© 2026 EquaSolver | Report Issue | Request Feature