← Back to Home

RPN Calculator - HP-11C Style Reverse Polish Notation Calculator | Online

/rpn-calculator
Experience an authentic HP-11C style RPN (Reverse Polish Notation) calculator online. Use postfix notation with stack operations, just like the legendary Hewlett-Packard programmable calculators. Supports ENTER key simulation, mathematical operations, stack manipulation, and constants. Perfect for HP calculator enthusiasts and RPN learners.
β–Ό Try it now

Parameters

expression undefined
RPN expression using HP-11C notation (e.g., "3e4+" for 3 ENTER 4 +)
stack undefined
Initial stack state as JSON array (e.g., [10,20])

Examples

bash
curl "https://tcpdata.com/rpn-calculator?expression=3e4%2B"
bash
curl "https://tcpdata.com/rpn-calculator?expression=5e*"
bash
curl "https://tcpdata.com/rpn-calculator?expression=3e4%2B5*"
bash
curl "https://tcpdata.com/rpn-calculator?expression=10%2B&stack=%5B5%5D"

Notes

πŸ”’ ABOUT HP-11C STYLE RPN

Experience the authentic Reverse Polish Notation (RPN) calculation method used by legendary HP calculators like the HP-11C, HP-12C, HP-15C, and HP-16C. RPN eliminates the need for parentheses and provides a more efficient way to perform complex calculations.

⌨️ HP-11C NOTATION

This calculator mimics the HP-11C keyboard behavior:

β€’ Numbers: Type digits directly (e.g., "34" = thirty-four)

β€’ ENTER key: Use "e" to duplicate top of stack (like pressing ENTER)

β€’ Operators: +, -, *, /, % automatically push numbers and execute

β€’ Example: "3e4+" pushes 3, ENTERs (duplicates to [3,3]), pushes 4 (becomes [3,4]), then adds = 7

πŸ“š OPERATIONS

Arithmetic: +, -, *, /, % (modulo)

Power: ^ (power), sqrt, x^2/sq (square), 1/x/recip (reciprocal)

Trigonometric: sin, cos, tan, asin, acos, atan

Hyperbolic: sinh, cosh, tanh

Logarithmic: ln (natural log), log (base 10), exp (e^x), 10^x/10x

Other: abs, neg, fact/factorial

Constants: pi (3.14159...), euler (2.71828...)

πŸ“Š STACK OPERATIONS

dup - Duplicate top of stack

drop - Remove top of stack

swap - Swap top two items

over - Copy second item to top

rot - Rotate top three items

clr - Clear entire stack

🎯 HOW RPN WORKS

Traditional: (3 + 4) * 5

RPN: 3 4 + 5 *

HP-11C: 3e4+5* (e = ENTER)

Step by step for "3e4+5*":

1. Push 3 β†’ [3]

2. ENTER (e) β†’ [3, 3] (duplicates)

3. Push 4 β†’ [3, 4] (replaces top)

4. Add (+) β†’ [7]

5. Push 5 β†’ [7, 5]

6. Multiply (*) β†’ [35]

πŸ’‘ EXAMPLES

Square a number: 5e* (5 ENTER Γ— = 25)

Cube a number: 5e5e** (5 ENTER 5 ENTER Γ— Γ— = 125)

Circle area (r=5): 5e*pi* (5Β² Γ— Ο€ = 78.54)

Calculate (3+4)*5: 3e4+5* (Result: 35)

Distance formula: 3e*4e*+sqrt (√(3²+4²) = 5)

πŸ”§ STATEFUL STACK

The calculator maintains a stack that persists across calculations.

Use the "stack" parameter to provide initial values:

?expression=10+&stack=[5] β†’ Adds 10 to 5 = [15]

?expression=swap&stack=[3,7] β†’ Swaps to [7,3]

πŸŽ“ LEARNING RPN

RPN Benefits:

β€’ No parentheses needed

β€’ More efficient for complex calculations

β€’ Natural for stack-based thinking

β€’ Same method used by millions of HP calculator users

Classic HP Calculator Timeline:

β€’ HP-35 (1972): First scientific pocket calculator

β€’ HP-65 (1974): First programmable handheld

β€’ HP-11C (1981): Legendary scientific programmer

β€’ HP-12C (1981): Financial calculator (still in production!)

β€’ HP-15C (1982): Advanced scientific

⚑ API FEATURES

RESTful API with step-by-step execution trace

Full stack state tracking

Comprehensive error handling

Complete HP-11C mathematical function support

❌ NOT YET IMPLEMENTED

The following HP-11C features are not yet available:

β€’ Statistical functions: Ξ£+, Ξ£-, mean, std dev

β€’ Conversions: β†’H.MS, β†’H, β†’RAD, β†’DEG, β†’P, β†’R (polar/rectangular)

β€’ Percentage functions: %Ξ”, %T

β€’ Memory registers: STO, RCL

β€’ Programming capabilities

β€’ Integration functions