Skip to content
cosmodev ~/tools/math-evaluator

수식 계산기

Converters & Formatters

수학 식을 안전하게 실시간으로 계산합니다 - 산술, 함수(sqrt, sin, log), 비교, 상수(pi, e). 입력은 수학에 안전한 문자로 제한되며 완전히 클라이언트에서 동작합니다.

Try:
결과
수식을 입력하면 결과가 표시돼요.

산술, 함수(sqrt, sin, log), 상수(pi, e). 입력은 수학에 안전한 문자로 제한됩니다.

(문서는 영어)

What it does

Evaluates a math expression as you type and shows the result in large type that scales with its length. The vocabulary is arithmetic, powers, and the common functions and constants: sqrt, sin, cos, tan, log, pi, e, and parentheses. Input is constrained to math-safe characters and evaluated locally in your browser. Nothing is transmitted.

How to use it

  1. Type an expression into the large centered field. It evaluates on each keystroke.
  2. Or tap an example chip: 2 * (3 + 4) / 5, sqrt(16) + 2^10, sin(pi / 6), log(e^3) + 7, 2^16 - 1.
  3. The result renders below, sized to fit. Clear empties the input, and the result leaves with it.
  4. Copy share link encodes the expression in the URL (?t=...).

Examples

Expression Result Note
2 * (3 + 4) / 5 2.8 parentheses first
sqrt(16) + 2^10 1028 4 + 1,024
sin(pi / 6) 0.49999999999999994 the honest floating-point answer, not 0.5
2^16 - 1 65535 the largest 16-bit unsigned value

The sin(pi / 6) result deserves its note. pi cannot be stored exactly in binary floating point, so the sine comes out one step off the tidy 0.5. That is correct IEEE 754 behavior, and the tool prints it rather than rounding behind your back.

How expression evaluation works

Evaluating a string typed by a stranger is the classic injection problem: JavaScript’s eval would run code, not math. This tool never calls eval. The input passes a guard first, and only a string made purely of math characters reaches the evaluator:

Allowed Blocked
digits, letters, spaces quotes and backticks
+ - * / % ^ ! ( ) , . < > brackets, braces, semicolons
expressions up to 200 characters keywords like import, eval, function

Letters are needed for sqrt and pi, so they pass the character check, but a word sequence that names code instead of math is rejected outright. Anything outside the vocabulary fails before evaluation, which also covers shared links: an expression planted in a ?t= URL dies at the same guard.

Good to know

  • log is natural: in this evaluator log means the natural logarithm (base e), so log(e) is 1. There is no separate ln function; an expression using one shows “Could not evaluate”.
  • No side effects: an expression can only produce a value. It cannot reach the page, the network, or your files.
  • Private: evaluation runs locally; nothing is transmitted.
  • Related tools: Percentage Calculator, Statistics Calculator, Number Base Converter.
소스 코드14개 언어

100% 클라이언트 측 · 데이터는 브라우저 밖으로 나가지 않습니다. 도움이 되었나요? 팀원에게 공유해 보세요.