Math / Computer Science
Programmer Calculator
Convert between decimal, binary, octal, and hexadecimal, and run bitwise operations at 8, 16, 32, or 64-bit word sizes.
Word size
Enter signed decimal values. Negative numbers are shown in two's-complement notation at the selected width, with both signed and unsigned interpretations.
Need a change for Programmer Calculator?
About this calculator
Method, formulas, and limits.What this does
Converts an integer between decimal, binary, octal, and hexadecimal at a selected word size, and applies AND, OR, XOR, NOT, and shift operations with a two's-complement interpretation.
Who it is for
Programmers, embedded developers, students, and anyone debugging bit masks, flags, protocol fields, or binary layouts.
How it works
Input values are parsed as signed decimal integers, masked to the selected word width, and displayed in all four bases as the exact two's-complement representation.
Limitations
This is a reference tool, not a language emulator. It does not interpret language-specific overflow traps, signedness, or machine instructions, and decimal input is limited to 20 digits.
Key calculations
- Two's complement
- negative values are stored as (2^width − |value|), which makes signed and unsigned the same bit pattern.
- Bitwise AND / OR / XOR
- AND: 1 if both bits are 1; OR: 1 if either is 1; XOR: 1 if the bits differ.
- Shift
- SHL shifts bits left filling zeros; SHR shifts right, and for signed values the sign bit is preserved in the two's-complement view.
How to use it
- 1.Enter an integerType a signed decimal value (up to 20 digits). Negative values use two's-complement notation.
- 2.Pick a word sizeChoose 8, 16, 32, or 64 bits; the displayed binary string is padded to that width.
- 3.Choose an operationAND, OR, XOR, and shifts use two operands; NOT uses only the first.
- 4.Read the basesThe result is shown in decimal, hex, octal, and binary so you can paste any representation.
Enter a decimal value, pick a word size, and choose an operation such as NOT. The panel shows the exact binary, hex, and octal representation of that value. For a pure conversion, any single-operand operation shows all four bases of the input.
Two's complement is how computers store signed integers: negative values wrap around the word size, so −1 in 8 bits is 0xFF. The calculator shows both the signed and unsigned decimal interpretation of the same bits.
Because the bits are the same. For example, −1 in 8 bits is 11111111, which is 255 when read as unsigned. The calculator shows both readings explicitly.
Results are masked to the selected word width, so bits shifted or carried beyond the width are dropped. Shift amounts larger than the width are clamped.
No. Languages differ in signedness, overflow handling, and shift semantics. Use this as a reference for the standard bit patterns, then confirm behavior in your toolchain.
Related calculators
Quick jumps
TI-84 Plus Calculator
TI-84 Plus style graphing calculator online: scientific functions, DEG/RAD modes, fractions, history, and ANS in your browser.
Scientific Calculator
Evaluate scientific expressions with common functions.
Fraction Calculator
Calculate exact fraction operations with reduction.
Percentage Calculator
Solve percentage questions, points, margins, and money cases.