Results appear here.
Evaluate fixed-width integer expressions, switch bases, flip bits and inspect endian, character and two’s-complement views.
How to use the programmer calculator
Enter a whole-number expression in the compact Expression field. Decimal literals need no prefix; use 0x for hexadecimal, 0o for octal and 0b for binary. You can mix bases in one expression, such as (0xBEEF << 8) | 0b1010. Numeric separators are accepted, so 0xffff_ffff is equivalent to 0xffffffff.
The calculator follows the usual integer precedence rules: multiplication, division and remainder run before addition and subtraction; additions run before shifts; shifts run before bitwise AND, XOR and OR. Parentheses are the clearest way to make an unfamiliar expression explicit. The supported operators are +, -, *, /, %, &, |, ^, ~, <<, >> and >>>.
Choose an 8, 16, 32 or 64-bit word and decide whether arithmetic should be interpreted as signed or unsigned. Every result is reduced to that word size. HEX, DEC, OCT and BIN switch the dominant result without changing its bits; that large result is editable, so you can paste a value in the selected base. The on-screen keypad inserts operators at the current expression caret, while the physical keyboard remains the fastest path for a complete C-style expression.
Reading fixed-width results
The bit pattern is the source of truth. HEX, OCT and BIN show the complete word, including leading zeroes. The unsigned and signed decimal readouts are two interpretations of those same bits. For example, the 8-bit pattern 1111 1111 is 255 when unsigned and -1 when interpreted as two’s complement.
“Result wrapped” means an arithmetic result did not fit the selected integer range and was reduced modulo the word size. In 8-bit unsigned mode, 0xff + 1 becomes 0x00. This is deliberate: the calculator models a fixed-width register rather than an unlimited mathematical integer.
Signed mode also affects division, remainder and >>. Division truncates toward zero. Right shift is arithmetic in signed mode, preserving the sign bit, and logical in unsigned mode. The explicit >>> operator always performs a logical right shift. Shift counts must be between zero and one less than the selected word size.
Rotations, byte order and characters
Use rol(value, count) and ror(value, count) for circular rotations. Rotation counts wrap modulo the word size, so rotating an 8-bit value by nine positions is the same as rotating it by one. bswap(value) reverses the byte order across the selected word: bswap(0x1234) in 16-bit mode produces 0x3412.
Binary, Endian and Character stay collapsed until you need them. Binary is a continuous, byte-grouped bit strip: Tab enters it once, arrow keys move the active bit and Space toggles it. A compact button on the right opens History with a short transition; on narrower screens the same control moves below the calculator. A direct bit edit, word-size conversion, editable-result change or byte swap exposes Undo so the original expression is recoverable.
Endian shows memory order from low address to high address. Big endian and little endian can be copied independently without changing the current value; Swap bytes is the explicit action that updates it. For the 32-bit value 0x00BEEF0A, big-endian order is 00 BE EF 0A, little-endian order is 0A EF BE 00, and the byte-swapped value is 0x0AEFBE00.
Character names common ASCII controls such as NUL, TAB, LF and CR for each byte. The Unicode row treats the entire unsigned result as one code point only when it is a valid scalar value; surrogate values and numbers above 0x10FFFF are reported as invalid. Press Enter in the expression field or = on the keypad to commit a successful calculation to History; live previews while typing are not saved. Up and Down recall committed expressions.
Common errors
This is an integer calculator, so decimal fractions and scientific notation are not accepted. Use whole-number literals only. A prefixed literal must contain digits valid for its base: binary accepts 0 and 1, octal accepts 0 through 7, and hexadecimal accepts 0 through 9 plus A through F.
Division by zero is rejected before calculation. Ordinary shifts reject negative or oversized counts because real languages and processors disagree on how those cases should behave. Extremely nested expressions are also rejected instead of risking a browser stack overflow. The evaluator uses its own parser and never passes your expression to JavaScript eval or Function.
FAQ
Why does changing signed mode alter division but not HEX? HEX describes the stored bits. Signedness only changes how those bits are interpreted for decimal arithmetic and arithmetic right shift.
Why are there leading zeroes? They make the selected word size visible. A 32-bit value always has eight hexadecimal digits and 32 binary digits, which makes masks and byte boundaries easier to inspect.
Is calculation history uploaded? No. Up to 50 expressions that you explicitly commit with Enter or = are stored in this browser’s local storage and can be cleared from the History panel. Nothing is sent to jig or another server.
Related
- Ethereum Unit Converter (Wei, Gwei, Ether)Convert Ethereum denominations (Wei, Kwei, Mwei, Gwei, Szabo, Finney, Ether, Tether) with arbitrary precision BigInt math.
- Number Base ConverterConvert numbers between binary, octal, decimal, hexadecimal, and arbitrary bases (2 to 36). Supports large BigInt precision.