Convert between Infix, Prefix (Polish), and Postfix (Reverse Polish) notations.
Enter your mathematical expression and choose the desired conversion type.
See how to use the converter with these common examples.
Convert a standard infix expression to its prefix equivalent.
Expression: (A + B) * C - D
Convert a standard infix expression to its postfix equivalent.
Expression: (A + B) * C - D
Convert a prefix expression back to its standard infix form.
Expression: * + A B - C D
Convert a postfix expression back to its standard infix form.
Expression: A B + C D - *
(3 + 4) * 5
, you would choose 'Infix to Prefix' or 'Infix to Postfix'.3 + 4 * 2
, the algorithm knows that *
has higher precedence. It processes 3
, then holds +
, processes 4
, then *
, then 2
. The *
is applied to 4
and 2
first, resulting in 3 4 2 * +
.(3 + 4) * 2
, the parentheses force the +
operation to be evaluated first, leading to the postfix 3 4 + 2 *
.