Formula Solver
Evaluate puzzle formulas with variables, ranges, and built-in functions.
Enter a formula and assign each letter variable a value. Wrap any part you want calculated in [ ] brackets, for example N 51 [A+B].[C*D] E 000 [E].[F-G]. Text outside the brackets is kept as is, so 5A.BCD simply fills in the digits. A variable can be a single value or a range such as 1-9 or 0;5;9, and every combination is solved. Alongside everyday math it also handles exact whole-number work: modular arithmetic, modular inverse, gcd and lcm, and bitwise operations, in decimal, hex, octal, or binary.
One formula per line. Reference an earlier line with {1}, {2}, and so on.
Variables found in the formula appear here. Enter a value or a range (1-9, 0;5;9) for each.
Supported functions, operators, and constants
Operators: + - * / ^ % (power and modulo), ! (factorial), and parentheses. The symbols × · ÷ and superscripts like 2³ also work.
Roots and logs: sqrt(x), nrt(x,n) (nth root), log(x) (base 10), ln(x), e(x).
Trig: sin cos tan (radians), sindeg cosdeg tandeg (degrees), and their arc… inverses.
Rounding: abs floor ceil sgn, round(x,decimals), min(…), max(…).
Geocaching helpers: cs(n) cross sum, csi(n) iterated cross sum, nth(n,start,end) pick digits, bww('TEXT') or av('TEXT') word value (A=1…Z=26), len('TEXT') length.
Modular and integer math: mod(a,b) remainder that is always 0 or positive (mod(-7,3) is 2), modpow(a,e,m) exact (a to the power e) mod m, modinv(a,m) modular inverse (the x with a·x ≡ 1 mod m), gcd(a,b,…), lcm(a,b,…).
Bitwise: and(a,b), or(a,b), xor(a,b), shl(a,n) shift left, shr(a,n) shift right.
Number bases: write hexadecimal, octal, or binary directly with 0x, 0o, 0b, for example 0xFF is 255 and and(0xFC,0x0F) is 12.
Constants: pi phi sqrt2 sqrt3 sqrt5 ln2 ln10.
Worked examples
| Formula | Result | What it does |
|---|---|---|
| [modpow(7,77,1000)] | 207 | Last 3 digits of a giant power, exactly. |
| [modinv(17,3120)] | 2753 | RSA-style modular inverse. |
| d=[modinv(A,26)] | with A=5: d=21 | Inverse for cracking an affine cipher key. |
| [gcd(462,1071,3675)] | 21 | Common divisor of several numbers. |
| [xor(0xCA,0xFE)] | 52 | Bitwise XOR of two hex bytes. |
| N 51 [mod(A+B,60)] | fills the minutes | Keep a sum inside a coordinate range. |