Formula Calculator — A Calculator That Saves Your Own Formulas#

Formula Calculator — a calculator that saves your own formulas

The original goal of this widgets corner was to build tools that are actually useful in everyday life. Turning a keyboard into a piano or flinging letters into the sky was fun, but honestly none of it was a “tool I’d use every day.” With this calculator, though, I finally feel like I’ve made something genuinely useful.

Whenever I need to calculate something, I tend to open a terminal and fire up a Python REPL — typing things like 3 * 1.08 or (70/1.75**2) as if they were code. Which is another way of saying the usual calculator apps never quite fit how I work. Pressing one button at a time felt slow, and the way a result vanishes the moment you’re done was frustrating. So I built this calculator widget for myself, first.

There are two core ideas: ① enter expressions on a single line (like code), and ② save the calculations you use often as formulas (functions) so you only swap in the numbers next time. Once you’ve defined something like vat(amount), bmi(weight, height), or compound(principal, rate, years), from then on you just plug in values. Functions can call other functions (composition), and you get if() conditionals and list aggregation like sum(range(...)) — all while the screen stays a plain calculator.

How to use

  • Input: The top area is display-only (no OS keyboard pops up on mobile). Enter with the buttons below. The result is computed live on the line beneath as you type.
  • PC keyboard: Hardware keyboard works too (the matching button flashes). Type letters directly to enter function names like sqrt( or sin(. Under Settings → Key mapping you can remap keys to your liking — e.g. press u to insert 1 (only where a keyboard is present).
  • Functions: Tap a function chip at the top to insert it. Use [ƒ] (or the Functions tab) to add/edit functions directly, or with an expression on screen press [Make function from this] to turn it into a formula (named f1, f2… automatically, editable).
  • Saving: Your functions and settings are stored in this browser. You can export/import your function set as JSON.
  • Examples: sum(range(1,100,1)) → sum of 1 to 100 (5050). Conditions too, like if(x>=90, 1, 0). Angles default to degrees (°); switch to radians in Settings.
© 2026 Ted Kim. All Rights Reserved. | Email Contact