Maths Calculator

Scientific calculator

Expression
Result 0
Live · order of operations respected

Answers you press = on show up here, and tapping one puts it back in the field.

This calculator evaluates a whole expression at once, respecting the usual order of operations: brackets, then powers, then multiplication and division, then addition and subtraction. It covers trigonometry in degrees or radians, natural and base-10 logarithms, any root, factorials up to 170!, floor and ceiling, e-notation, π and e, and reuses the previous answer through Ans.

How to use it

1 Type the expression, or tap it out on the pad. Both edit the same field.
2 The result updates as you type; press = to commit it and start a new line from the answer.
3 Switch DEG and RAD before doing trigonometry. It changes the answer, not the display.
4 For a root use sqrt, cbrt or a fractional power: 32^(1/5) is the fifth root. For a factorial, type the number then !.
5 To round, wrap the expression: round(x×100)÷100 gives two decimal places, and round(x÷5)×5 gives the nearest five.
6 Press Ans to fold the previous answer into the next line rather than retyping it.

Two conventions are worth stating because calculators disagree about them. Here, −2² is −4: the power binds tighter than the minus sign, so it reads as −(2²). And 2^3^2 is 512, because powers group from the right, giving 2^(3^2). If you want the other reading, use brackets. That is what they are for.

Powers and roots are one operation

A negative exponent is a reciprocal, so 2^(−3) is 0.125, bracketed because the field will not read a bare minus after ^. A fractional exponent is a root, so x^(1/2) is the square root and x^(1/3) the cube root. That is why there is no separate nth-root key: 32^(1/5) gives 2. The square root of a negative number is unavailable, since the result is imaginary; the cube root of a negative is real, and cbrt(−27) returns −3.

Rounding: scale, round, scale back

Rounding is done with round, floor and ceil, and the pattern never changes. round(x×100)÷100 gives two decimal places; round(x÷5)×5 gives the nearest five. Two things to know about it. Halves go toward positive infinity here instead of away from zero, so 2.5 gives 3 while −2.5 gives −2. And floor is not truncation: the two agree on positive numbers and part company on negatives, where floor(−2.5) is −3 while truncating gives −2, which is what round returns there too. What an expression field cannot express is banker’s rounding, the round-half-to-even convention that spreadsheets and financial systems use so the upward bias cancels across many values — there is no way to write it as a formula in one line. When a total has to reconcile against a system that rounds to even, take the number to the rounding calculator, which puts standard, banker’s, ceiling, floor and truncation on the same value side by side.

Significant figures are a reading rule and an arithmetic one

Counting them is not arithmetic and no expression field can do it, because the count depends on how the number was written rather than on its value: 1200 and 1200.0 are the same quantity and claim two figures and five. Rounding to a number of figures is arithmetic, and it is the decimal-places recipe with the scale worked out first instead of chosen: floor(log(x)) is the position of the leading digit, so the step for n figures is 10^(floor(log(x)) − n + 1). Three figures of 0.0045678 is round(0.0045678 ÷ 10^(−5)) × 10^(−5), giving 0.00457; three figures of 12345 is round(12345 ÷ 10^2) × 10^2, giving 12300. That is worth knowing when you are already mid-expression, but it is a recipe rather than an answer — the significant figures calculator does both halves, counting what you wrote and rounding to what you need. How many figures an answer deserves is decided by its inputs, and the two rules differ: multiplying and dividing, the result takes the significant figures of the least precise input; adding and subtracting, it takes the decimal places of the least precise input instead.

Scientific, engineering and e notation

Scientific notation can be typed straight in as 1.2e3, and large answers come back the same way. The e means "times ten to the power of" and has nothing to do with Euler’s number, which here is spelled e on its own. Scientific notation keeps exactly one non-zero digit before the point, which is what makes two numbers in it directly comparable: compare exponents first, mantissas only if the exponents match. Engineering notation relaxes that rule and holds the exponent to a multiple of three instead, so it lines up with the SI prefixes. 47000 is 4.7e4 written scientifically and 47e3 written for engineering, which reads off as 47 k without a second thought, and a component value in engineering notation converts to picofarads or megohms by inspection. Nothing switches between the two, because the conversion is a division: pick the power of a thousand you want and read the mantissa that comes back.

Formulas you can type instead of look up

Anything with a closed-form solution can be typed out, provided it is typed the way this field reads. The quadratic formula is one line: for a quadratic equation in standard form, ax² + bx + c = 0, taking 2x² − 6x + 4 = 0 gives (6 + sqrt(6^2 − 424)) ÷ (22), which comes to the root 2. Both brackets are load-bearing. ÷ and × bind equally tightly and evaluate left to right, so ÷22 would multiply by 2 instead of dividing by 4; and the field does not read a superscript, so write 6^2 and not 6². The term under the root, b² − 4ac, is the discriminant, and its sign tells you what to expect before you evaluate anything: positive gives two real roots, zero one repeated root, and negative a complex pair this field has no way to show. Each root also needs its own line, once with a plus and once with a minus, and the vertex is a third. When you want both roots, the discriminant and the turning point together, that is what the quadratic equation solver is for.

The two’s complement of a value at a given width is 2ⁿ − v, so 2^8−5 gives 251, which is the decimal reading of the 8-bit pattern for −5; by hand the same thing is inverting every bit of 5 and adding one. What this field cannot give you is the pattern itself, 11111011, because it evaluates to a number and a bit pattern is not one — the two’s complement calculator shows the binary and hex at 4, 8, 16 or 32 bits and says whether the value fits. The width decides the range, and eight bits hold −128 to 127 instead of −127 to 127, because zero takes a slot on the positive side and leaves one fewer value there. Anything above the top of that range wraps silently instead of erroring, so adding 1 to 127 in eight bits gives −128. The reason the representation is used at all is that one adder then serves signed and unsigned arithmetic alike.

What people use it for

  • Evaluating a whole expression at once rather than one key at a time
  • Raising a number to a power, including negative and fractional ones
  • Square, cube and nth roots
  • Factorials, and the size of a search space
  • Trigonometry in degrees or radians, switched without retyping
  • Natural and base-10 logarithms
  • Rounding to decimal places, or to the nearest five or ten, inside a longer expression
  • Chaining a calculation through Ans instead of copying numbers between lines
  • Settling what −2² and 2^3^2 evaluate to

Questions

Yes. 2π, 3(4+5) and (1+1)(2+2) all work and mean what they look like. You do not have to close your brackets either: an expression with brackets still open is closed for you, so a live answer appears while you are still typing.

Was this tool any good?
Internal signal only · I use it to find the tools worth rebuilding