Polish Notation Converter
Convert expressions between infix, prefix Polish notation, and postfix Reverse Polish notation with an instant, readable result.
About Polish notation conversion
Polish notation examples
These examples show equivalent expressions in different notation systems.
| Input | Output | Conversion |
|---|---|---|
| (A + B) * C - D | - * + A B C D | Infix to prefix |
| A + B * C | A B C * + | Infix to postfix |
| * + A B - C D | ((A + B) * (C - D)) | Prefix to infix |
| A B + C D - * | ((A + B) * (C - D)) | Postfix to infix |
How to use the notation converter
- Choose one of the four conversion types to identify the notation you are entering and the notation you want.
- Enter the expression, using spaces between every token when the source is prefix or postfix notation.
- Select Convert to parse the expression and display its equivalent notation.
- Check the operator order in the result, or select Reset to clear the expression and begin again.
Polish notation converter FAQ
What is Polish notation?
Polish notation places each operator before its operands, so A + B becomes + A B. This arrangement removes the need for parentheses when every operator has a known number of operands.
What is Reverse Polish notation?
Reverse Polish notation places the operator after its operands, so A + B becomes A B +. It is also called postfix notation and is commonly evaluated with a stack.
Do prefix and postfix expressions need spaces?
Yes, this converter expects spaces between prefix or postfix tokens so multi-character values remain unambiguous. For example, write + total 25 rather than +total25.
How does the converter handle operator precedence?
In infix expressions, exponentiation has the highest precedence, followed by multiplication and division, then addition and subtraction. Parentheses override that normal order.
Can I use numbers and variable names together?
Yes, operands may be decimal numbers or identifiers made from letters, digits, and underscores. The converter rearranges tokens without evaluating their numeric value.