Programmer Calculator

Work in hex, binary, octal and decimal.

0

How to use the programmer calculator

  1. Type a number

    Tap HEX, DEC, OCT or BIN to choose which base you're typing in — the other three update instantly so you can see the same number every way at once.

  2. Use AND, OR, XOR, NOT or a shift

    Pick a bitwise button, type the second number, then press "=". Choose 8, 16, 32 or 64-bit above the keypad to match the word size you're working with.

  3. Get your answer

    Your answer shows in the base you last picked, with HEX, DEC, OCT and BIN all updated above it. Copy it with the "Copy" button.

Questions

How do I convert a number from hex to decimal (or the other way)?

Tap the HEX row and type your hex number — the DEC row underneath updates straight away, and so do OCT and BIN. It works the other way round too: type a decimal number with DEC selected and read off HEX.

What do AND, OR, XOR and NOT do?

They compare numbers bit by bit. AND gives a 1 only where both numbers have a 1. OR gives a 1 where either number does. XOR gives a 1 where exactly one of them does. NOT flips every bit in a single number (0s become 1s and 1s become 0s).

What does word size (8/16/32/64-bit) mean, and why do numbers wrap around?

It's how many bits the number is stored in — the same choice a programming language makes for a number's type. A number that goes above what fits wraps back round to the start, the same way a car's odometer rolls over from 999999 to 000000. Pick the word size that matches what you're working with; 32-bit is the everyday default.

What are the ≪ and ≫ buttons for?

They're bit shifts. ≪ (shift left) moves every bit left and is the same as multiplying by 2 for each place shifted. ≫ (shift right) moves every bit right, the same as dividing by 2 and dropping the remainder.

Why are some letters and numbers greyed out?

Because they're not valid in the base you've selected. In DEC (decimal) mode, A–F are greyed out since decimal only uses 0–9; switch to HEX to use them. In BIN (binary) mode, only 0 and 1 are available.

Will my history and memory still be there next time?

Yes. Your calculation history and the memory value (M) are kept on this device, so they're waiting for you next time you open the calculator. Use "Clear" in the History panel if you'd rather start fresh.