How to use the HP 12C online: loans, NPV and IRR

Work out a loan payment, an NPV and an IRR on a real HP 12C keyboard, one keystroke at a time.

The HP 12C went on sale in 1981, and finance professors still put it on the syllabus as if nothing had changed since. If you don't have one in your bag, the HP 12C calculator online gives you the full keyboard in a browser tab. The examples below were all run on it, so the numbers you see are the numbers you should get.

Try it: click the calculator, then type

How it works

  1. Click the calculator once so it takes your keyboard.
  2. Key the first number, press ENTER, key the second number, then press the operation or the financial key.
  3. Read the answer on the display. The stack panel and the paper tape below it show how you got there.

RPN in one minute

The 12C has no equals key. You give it the numbers first and the operation last, so 5 ENTER 3 + shows 8. Each number you key lands in X, the bottom of a four-level stack, and ENTER pushes it up to Y so the next one has room. An operation takes X and Y and leaves the result in X.

That is also why you never need parentheses. To get (2 + 3) × 4, press 2 ENTER 3 + 4 ×. The 5 from the first step waits in the stack until the × picks it up. It feels odd for about ten minutes. After that, calculators with an equals key start to feel slow.

A car loan payment

Say you borrow $25,000 for 60 months at 7.2% a year. Clear the financial registers first with f CLEAR FIN, because the 12C remembers the last problem and will happily mix it into this one. Then:

60 n   7.2 g 12÷   25000 PV   PMT

The display shows -497.39. g 12÷ divides the annual rate by 12 and stores it in i, which saves you doing it by hand. The minus sign isn't an error. The 12C follows the cash: the $25,000 you receive is positive, the payments you send back are negative. Get a sign wrong when you solve for a rate or a term and the calculator answers with Error 5.

Any of the five keys can be the unknown. Key four of them and press the fifth. With the same loan, typing 450 CHS PMT and then n answers 68: that's how many months it takes at $450 a month. The 12C rounds n up to a whole period, so the last payment is a little smaller than the others.

NPV and IRR on uneven cash flows

A project costs $10,000 today and returns $3,000, $4,000 and $5,000 over the next three years. Is it worth it at a 10% cost of capital?

f CLEAR FIN   10000 CHS g CF0   3000 g CFj   4000 g CFj   5000 g CFj   10 i   f NPV

NPV comes out at -210.37, so at 10% the project destroys a little value. Press f IRR straight after and the display shows 8.90: that is the rate at which the same cash flows break even.

If several years repeat the same amount, key the amount once with g CFj and then the count with g Nj. Twelve identical months take two keystrokes, not twelve.

Typing instead of clicking

Clicking keys gets old fast. Once the calculator has focus, digits, the four operators and Enter do what you'd expect, f and g are the shift keys, and n, i, P, M and V map to n, i, PV, PMT and FV. H is CHS. The full map sits in Keyboard Shortcuts under the calculator.

Like the hardware, it never forgets. Close the tab, come back tomorrow, and your registers and programs are where you left them. Save memory writes everything to a small text file you can load on another machine, and Program editor opens a separate window that lists your program step by step.