RPN Calculator - Stack Replay, Memory Keys & Precision

Calculator

Online RPN calculator with DEG/RAD/GRAD trig, stack and history replay, STO/RCL memory registers, and fixed/scientific/engineering precision.

Enter your first number

Enter your next number and an operator

Chain more operations

Use stack functions

Formulas and sources

Each formula this calculator uses, where it comes from, and what it leaves out.

Two-number operations (+, −, ×, ÷)

Result = Y + X Result = Y − X Result = Y × X Result = Y ÷ X
X
the number on top of the stack
Y
the number beneath it
Result
what goes back on the stack

Both numbers leave the stack and the result takes their place. Dividing by zero is refused.

Source: Uses the operand order in HP's RPN guide for the HP 35s [1]: X is subtracted from, multiplied by or divided into Y.

Power (y^x)

Result = Y^X
Y
the base, beneath the top of the stack
X
the exponent, on top

A negative base needs a whole-number exponent. HP’s guide works 2 Enter 10 y^x and gets 1,024, as this does.

Source: Standard formula; no single publisher. The worked example is from [1].

Percent key (%)

Result = Y × X ÷ 100
Y
the base amount
X
the percentage

Both numbers leave the stack and only the result stays. The HP 12c’s key gives the same amount but keeps Y on the stack, so a net amount there is one + or − away; here, enter the base again.

Source: Based on the HP 12c's percent key [2] (300 Enter 14 % is 42); the stack effect differs.

One-number functions

Result = √X Result = X² Result = 1 ÷ X Result = −X
X
the number on top of the stack

Each replaces the top of the stack. The square root of a negative number and 1 ÷ 0 are refused. HP’s first example, 1.2 x² 0.5 x² + √, gives 1.3.

Source: Standard formulas; no single publisher. The worked example is from [1].

Logarithms and exponentials

Result = ln X Result = log X = ln X ÷ ln 10 Result = 10^X Result = e^X
X
the number on top of the stack

Both logarithms need a positive X. A result too large for the calculator, such as 10^310, is refused.

Source: Uses the definitions in the NIST Digital Library of Mathematical Functions [3].

Trigonometric functions (DEG, RAD, GRAD)

Result = sin(X × U) Result = asin(X) ÷ U
X
the angle, or for an inverse key the value
U
radians in one angle unit: π/180 in DEG, 1 in RAD, π/200 in GRAD

cos and tan work as sin does, and acos and atan as asin. tan is refused at 90° and 270° (100 and 300 grad). π cannot be stored exactly as a double, so sin 180° shows 1.2246e-16 rather than 0.

Source: Angle units as NIST defines them [4] [5]: 1° = π/180 rad and 1 gon = 0.9°. The functions as the DLMF defines them [6], computed as ECMA-262 allows [7].

Factorial (n!)

n! = n × (n − 1) × … × 2 × 1
n
a whole number from 0 to 170; 0! is 1

Worked out as a running product of doubles. It is exact up to 22!. From 23! the product has more digits than a double holds, and at 15 digits 17 of the values up to 170! differ in the last digit, the first at 79!.

Source: Uses the definition in NIST's Dictionary of Algorithms and Data Structures [8].

Stack behavior

Enter pushes the number you typed once; Enter with nothing typed copies the top. The stack has no fixed depth. An HP calculator holds four values (X, Y, Z and T) and its Enter copies X into Y, so 6 Enter + gives 12 there and is refused here.

Source: Based on the four-value stack in HP’s guides [1] [2]; the differences are CalcTrail’s own.

Constants and memory

The π and e keys enter 3.141592653589793 and 2.718281828459045, every digit a double holds of the values NIST lists. STO copies X into M1 to M4 and leaves X on the stack, as the HP-35’s STO key does; SUM and SUB add X to M1 or take it away.

Source: π and e: [9]. STO: [10]. The four registers and SUM and SUB: CalcTrail’s own; no publisher.

Display formats

Auto shows up to 15 significant digits, in exponential form from 10^15 up and below 10^-9. Fixed shows d decimal places, Scientific d digits after the point, and Engineering an exponent that is a multiple of three. They change what is shown, never the stack.

Source: CalcTrail’s own display rules; no publisher.

Sources

  1. Hewlett-Packard. HP 35s Using RPN Mode, pp. 2 to 6: the stack, ENTER, LAST x and Examples 1 and 4. Version 1.0, training aid.
  2. Hewlett-Packard. HP 12c Financial Calculator User’s Guide, Section 2, Percentages (p. 26), and Appendix A, the automatic memory stack (p. 174). Edition 4, August 2004, part number 0012C-90001.
  3. National Institute of Standards and Technology. NIST Digital Library of Mathematical Functions, §4.2: the logarithm (4.2.1), a general base (4.2.8) and the exponential (4.2.19). Release 1.2.8, September 15, 2026.
  4. National Institute of Standards and Technology. NIST Guide to the SI, Chapter 5: Units Outside the SI, Table 6, the degree. Special Publication 811 (2008), web page updated December 8, 2025.
  5. National Institute of Standards and Technology. NIST Guide to the SI, Appendix B.8: Factors for Units Listed Alphabetically, gon (also called grade). Special Publication 811 (2008), web page updated August 18, 2025.
  6. National Institute of Standards and Technology. NIST Digital Library of Mathematical Functions, §4.14, sine, cosine and tangent, and §4.23, their inverses. Release 1.2.8, September 15, 2026.
  7. Ecma International, TC39. ECMAScript Language Specification (ECMA-262), §21.3.2, Function Properties of the Math Object, the note. Living standard, titled ECMAScript 2027, read October 4, 2026.
  8. National Institute of Standards and Technology. Dictionary of Algorithms and Data Structures: factorial. Entry modified March 2, 2015.
  9. National Institute of Standards and Technology. NIST Digital Library of Mathematical Functions, §3.12, π (3.12.1) and e (3.12.3). Release 1.2.8, September 15, 2026.
  10. Hewlett-Packard. HP-35 Operating Manual, p. 18, the STO key. First edition, 1972.

What this calculator does not cover

  • This is a stack calculator for real numbers. It has no programming, complex numbers, statistics, base conversion or financial keys such as the HP 12c has.
  • Results are double-precision numbers. A trigonometric result whose exact value is zero can show a tiny residue, such as 1.2246e-16 for sin 180°.

Sources checked on .

Help

Quick Start Guide

  1. Enter your first number: Type a number, then press Enter to push it onto the stack.
  2. Enter your next number and an operator: The operator applies to the top two stack values and pushes the result back.
  3. Chain more operations: Keep entering numbers and operators; no parentheses or equals sign needed.
  4. Use stack functions: Swap, Roll ↓/↑, Drop, or Last X to manipulate the stack without retyping.
  5. Store values in memory: In Advanced mode, use STO and RCL with four registers (M1–M4); SUM M1 and SUB M1 add to or subtract from M1.
  6. Set precision and notation: Choose Auto, Fixed, Scientific, or Engineering notation.
  7. Review your history: Replay steps through the stack state before and after each operation.

Frequently Asked Questions

Yes. The Search History box above the list filters a long session by operation or result, so you can find the line you want without scrolling. Type sin to see only the trig steps, or part of a number to find where it came from. Exporting while a search is active exports what you are looking at, and the operation count in the export reflects the filtered list rather than the whole session.

Last updated