# Polish Notation Converter

URL: https://speedycalculator.com/calculators/math/polish-notation/
Last updated: 2026-10-30

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

## Inputs

- Conversion
- Expression

## Results

- Result
- Prefix (Polish)
- Postfix (reverse Polish)
- Infix
- Value

## Formula

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

## Explanation

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

- **Conversion**
- **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.

## 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.

## FAQ

**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

- [Wolfram MathWorld – Reverse Polish notation](https://mathworld.wolfram.com/ReversePolishNotation.html)
- [OpenStax – Contemporary Mathematics](https://openstax.org/details/books/contemporary-mathematics)
