← All tools

RPN Calculator

Evaluate expressions in Reverse Polish Notation (postfix) — or convert a standard infix expression to RPN with Dijkstra's shunting-yard algorithm and then evaluate it. RPN needs no parentheses: 3 4 + 2 * means (3+4)*2. The tool shows the RPN form, the result, and a step-by-step trace of the stack as each token is processed, so the evaluation is transparent. Supports + − * / % ^, unary minus, constants pi and e, and functions sin cos tan asin acos atan ln log sqrt cbrt abs exp. Everything runs locally in your browser.

Expression
Infix input — operators + − * / % ^ (right-assoc), parentheses, unary minus, functions, and constants pi/e. Example: (1 + 2) * 3 ^ 2.

Stack trace

Reverse Polish Notation writes the operator after its operands, so evaluation is a single left-to-right pass with a stack: push numbers; on an operator, pop its operands, compute, push the result. There are no precedence rules and no parentheses. The shunting-yard algorithm converts the familiar infix form to RPN by emitting numbers immediately and using an operator stack, comparing precedence and associativity (^ is right-associative; the rest are left-associative). Pairs with the Calculus Toolkit and Bitwise Calc. Everything runs locally — nothing leaves your browser.