Polish Notation Converter

Quick answer

The Polish notation converter turns ordinary infix expressions into prefix (Polish) or postfix (reverse Polish) notation and back, and evaluates numeric expressions.

Result
3 4 + 2 * 10 5 / -
Prefix (Polish)
- * + 3 4 2 / 10 5
Postfix (reverse Polish)
3 4 + 2 * 10 5 / -
Infix
(3 + 4) * 2 - 10 / 5
Value
12

Polish notation, invented by Jan Łukasiewicz, writes operators before their operands, so no brackets are needed. Reverse Polish notation (operators after operands) is used by HP calculators, the Forth and PostScript languages and inside compilers.

How to use the Polish Notation Converter

  1. Conversion
  2. Expression

Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.

How it works

Infix expressions are converted with Dijkstra’s shunting-yard algorithm, respecting precedence (^ before × ÷ before + −) and right-associative powers. Prefix and postfix inputs are parsed into an expression tree and printed back with the minimum brackets.

Formula

Infix (A + B) × C ↔ Prefix × + A B C ↔ Postfix A B + C ×

Worked example

Inputs — Conversion: Infix → postfix; Expression: (3 + 4) * 2 - 10 / 5.
Results — Result = 3 4 + 2 * 10 5 / -; Prefix (Polish) = - * + 3 4 2 / 10 5; Postfix (reverse Polish) = 3 4 + 2 * 10 5 / -; Infix = (3 + 4) * 2 - 10 / 5; Value = 12.

Key terms

Infix
Operators between operands, as usually written.
Shunting-yard algorithm
Dijkstra's method for converting infix to postfix.

Frequently asked questions

What is reverse Polish notation?

Postfix notation: operators follow their operands, e.g. 3 4 + for 3 + 4.

Why are brackets not needed?

The order of operators and operands fixes the order of evaluation.

Which operators are supported?

+ − * / and ^, with letters or numbers as operands.

How do I separate tokens in prefix input?

With spaces, e.g. "- * + 3 4 2 / 10 5".

Sources

  1. Wolfram MathWorld – Reverse Polish notation
  2. OpenStax – Contemporary Mathematics

Cite this calculator

Speedy Calculator. (2026). Polish Notation Converter. Speedy Calculator. https://speedycalculator.com/calculators/math/polish-notation/