Skip to main content

HEX·DEC·OCT·BIN calculator user guide

The HEX·DEC·OCT·BIN integrated calculator runs in your browser: see four radices at once, work with large integers (BigInt), and use arithmetic, modulo, bit shifts, logic gates, plus Advanced helpers for verification-style tasks.

The flow is similar to the Windows Programmer calculator.

👉 Open the tool: Open the integrated calculator


What you can do

  • Show the same value on HEX / DEC / OCT / BIN rows and switch which radix you type in
  • Build expressions with parentheses; the small formula line above the main display shows progress in decimal
  • Bitwise gates: NOT, AND, OR, XOR, NAND, NOR, XNOR
  • Advanced (expanded by default; collapse with the toggle): bit width (32–128), ROL/ROR, popcount / parity, byte-swap, , floor √, |x|, GCD/LCM, ModPow (three-step entry), paste from clipboard
  • Press = to commit; finished lines appear in History on the right, with per-radix expand and Copy

Useful for docs, debugging, and teaching when you need quick radix checks and integer math.

It does not replace vendor synthesis or timing sign-off.


UI map

AreaRole
Main displayCurrent entry (or intermediate result), focused on the active radix
Small formula lineIn-progress expression in decimal with parentheses, until =
Four radix rowsValue per radix, label, copy, Full (expand)
Keypad (3 columns)Gates (left), main keypad (center), Advanced (right)
HistoryEach = result; click an item to expand all bases and copy

The keypad keeps gates, main, and Advanced on one row within the panel width—there is no horizontal scrollbar to pan the keypad.

On very narrow viewports, spacing and key size shrink instead.


Switching radix and typing

  • Click the label (HEX/DEC/OCT/BIN) and the number area on a row to make that radix active for input.
    The Full and Copy controls do not switch radix.
  • A–F keys are enabled only in HEX.
  • The 2’s complement key is enabled only in DEC (see below).

Long values, Full, and Copy

  • Long values show an ellipsis in each radix row.
    Full expands to the complete string for that radix.
  • Copy sends that radix text to the clipboard.

Main keypad

  • Digits / operators: only characters valid for the active radix are accepted.
  • Lsh / Rsh: logical bit shifts left/right.
    (Not the same as multiply/divide by 2 in all edge cases.)
  • %: remainder.
  • ( / ): evaluate the inner subexpression first, then feed it to the outer operation.
  • Binary ops chain left to right; there is no implicit multiply/divide-before-add/subtract—use parentheses.
  • =: commits only when there are no open parentheses. Committed lines go to History.
  • CE / Backspace: clear entry / delete one character.

Two’s complement (DEC only)

  • With DEC input, use 2’s complement (or F9) to negate the value.
  • For negatives, HEX/OCT/BIN rows show a 64-bit two’s-complement bit pattern (space grouped).

Gates (bitwise logic)

KeyMeaning
NOTBitwise invert ~ of the current entry
AND / OR / XORBinary bitwise ops on both operands
NAND / NOR / XNOR~(a&b), `~(a

Binary gates follow the usual left · op · right flow like other operators.


Advanced

Advanced is open by default; click the header to collapse.
Hover ? for a quick cheat sheet.
Each button has a tooltip with more detail.

Bit width (32 / 64 / 128)

ROL, ROR, popcount, parity, byte-swap apply inside the selected unsigned bit span (masked width).

ROL / ROR

Rotate by one bit inside the width; bits wrap to the other end.

Pop / Par

  • Pop: count of 1 bits after masking to the width.
  • Par: XOR-fold those bits → 0 or 1.

BSwap

Reverse byte order inside the width. Width must be a multiple of 8.

x² / √ / |x|

  • : integer square (may error if huge).
  • : non-negative only; floor integer square root.
  • |x|: absolute value.

GCD / LCM

Greatest common divisor / least common multiple. You can chain them like other binary ops.

ModPow (modular exponentiation)

  1. Enter base, press ModPow
  2. Enter exponent, press ModPow
  3. Enter m, press ModPowbase^exp mod m

Paste

Parse clipboard text as a number in the active radix into the entry (0x allowed in HEX).


History

  • = appends the expression and decimal result.
  • Click a row to expand all radices and use per-row Copy.

Keyboard shortcuts

Shortcuts are ignored while focus is in a text field (inputs, search, etc.).

KeyAction
Digits / numpadWhen valid for the active radix
A–FIn HEX
+ − * / %Operators
( )Parentheses
= or EnterEquals (same rules as = button)
BackspaceDelete one character
Esc / DeleteClear entry (CE)
F9Two’s complement negate (DEC only)

FAQ

Is everything truncated to a fixed bit width?
No. Core math uses signed arbitrary-size BigInt.

The Advanced width applies only to those ops (ROL, popcount, etc.).

Floats / decimals?
Integers only.

I messed up ModPow steps.
Reset by clearing entry or starting a cleaner flow.

When in doubt, CE and re-enter base → ModPow → exp → ModPow → m → ModPow.


See also