Polish Notation Converter
Convert expressions between infix, prefix Polish notation, and postfix Reverse Polish notation with parse steps and expression-tree traversal.
Last Updated: May 2026
Prefix Polish
* + A B - C D
Postfix RPN
A B + C D - *
Fully Parenthesized Infix
((A + B) * (C - D))
Tree Depth
3
Notation Converter Inputs
Convert binary arithmetic expressions between infix, prefix Polish notation, and postfix Reverse Polish notation.
Prefix and postfix examples should be space-separated.
Supports values, variables, parentheses in infix mode, and binary + - * / ^ operators.
Conversion Results
| Output | Rule | Value |
|---|---|---|
| Original tokens | ( A + B ) * ( C - D ) | 11 tokens |
| Prefix Polish | preorder: operator, left, right | * + A B - C D |
| Infix | left, operator, right | ((A + B) * (C - D)) |
| Postfix RPN | postorder: left, right, operator | A B + C D - * |
| Expression tree nodes | operators plus operands | 7 |
Parse Steps
| Step | Action | Result |
|---|---|---|
| 1 | Tokenize the input | ( A + B ) * ( C - D ) |
| 2 | Use shunting-yard precedence to build postfix | A B + C D - * |
| 3 | Build a binary expression tree | 7 nodes |
| 4 | Traverse tree as prefix, infix, and postfix | All notation outputs are generated from the same tree. |
Expression Parsing Notice
This converter is for notation practice and expression-structure checks. It supports binary arithmetic operators only and does not evaluate expressions, simplify algebra, or parse functions.
Checked by Jitendra Kumar
Polish Notation Converter is checked for formula labels, source links, and result limits.
Jitendra Kumar, Founder & Editorial Standards Lead. Updated May 2026. Scope: math calculators.
How to Use the Polish Notation Converter
Choose the notation of your input expression. Infix expressions can use parentheses, while prefix and postfix expressions should use space-separated operators and operands.
Enter an expression with variables, numbers, and binary +, -, *, /, or ^ operators. The converter returns prefix Polish, fully parenthesized infix, and postfix RPN forms.
Step 1: Choose input notation
Select infix, prefix Polish, or postfix Reverse Polish notation.
Step 2: Enter the expression
Use values or variables with binary arithmetic operators.
Step 3: Review converted forms
Compare prefix, infix, and postfix outputs built from the same expression tree.
Step 4: Check parse steps
Use the token and parse-step tables to verify the conversion logic.
How This Polish Notation Converter Works
The converter tokenizes the input, then builds a binary expression tree. Infix input is first converted with operator precedence rules similar to the shunting-yard algorithm.
Prefix input is read from right to left with a stack. Postfix input is read from left to right with a stack. Each binary operator combines two operands into a new tree node.
Once the tree exists, prefix notation is a preorder traversal, infix notation is an inorder traversal, and postfix notation is a postorder traversal.
Polish Notation Guide
Notation Types
| Notation | Example | Meaning |
|---|---|---|
| Infix | (A + B) * C | Operators are written between operands. |
| Prefix Polish | * + A B C | Operators are written before their operands. |
| Postfix RPN | A B + C * | Operators are written after their operands. |
| Expression tree | operator with left and right children | A shared structure used to generate all three forms. |
Infix Operator Rules
| Operator | Precedence | Rule |
|---|---|---|
| ^ | Highest | Right associative in infix mode. |
| * and / | Middle | Evaluated before addition and subtraction. |
| + and - | Lowest | Evaluated left to right. |
| Parentheses | Override precedence | Supported in infix input only. |
Examples
| Input type | Input | Prefix output | Postfix output |
|---|---|---|---|
| Infix | (A + B) * (C - D) | * + A B - C D | A B + C D - * |
| Prefix | * + A B - C D | * + A B - C D | A B + C D - * |
| Postfix | A B + C D - * | * + A B - C D | A B + C D - * |
| Power | a + b * c ^ d | + a * b ^ c d | a b c d ^ * + |
Keep the research moving with Scientific Calculator, Math Equation Solver, Distributive Property Calculator, and Associative Property Calculator.
Frequently Asked Questions
Related Calculators
Scientific Calculator
Evaluate advanced expressions with trig, logarithms, powers, roots, and memory.
Use Scientific CalculatorMath Equation Solver
Solve linear, quadratic, and polynomial equations with step-by-step transformations.
Use Math Equation SolverDistributive Property Calculator
Expand and simplify a(b + c) or a(b - c) expressions.
Use Distributive Property CalculatorAssociative Property Calculator
Compare grouped expressions to verify associative behavior.
Use Associative Property CalculatorRelated Guides

Algebra & Equation Calculators Guide
Use this for equation solving, cross multiplication, distributive and associative properties, reverse FOIL, sum of products, consecutive integers, multiplicative inverses, powers of i, and Polish notation.
Read guide
Math Formulae Page: 440 K-12 Formulas
Use this as a broad formula reference across arithmetic, algebra, geometry, trigonometry, statistics, matrices, vectors, and calculus readiness.
Read guideSources & References
- 1.Wolfram MathWorld - Polish Notation(Accessed May 2026)
- 2.Wolfram MathWorld - Reverse Polish Notation(Accessed May 2026)
- 3.Dijkstra - Shunting Yard Algorithm(Accessed May 2026)