DevTools Logo

Programmer Calculator

Programmer Calculator

See a value in every base at once, flip bits, run bitwise operations, and inspect IEEE 754 floats — all client-side.

Word Size

Value Input

Unsigned: 255Signed: 255

Bits(tap bit to toggle)

Examples

Inspect -1 as an 8-bit word

Input
Word size: 8-bit
DEC: -1
Output
HEX: FF
DEC: 255
OCT: 377
BIN: 1111 1111
Unsigned: 255
Signed: -1

Masking -1 to eight bits produces 255, while interpreting the same sign bit as two's complement produces -1.

XOR two binary masks

Input
Word size: 8-bit
Operand A: 0b1100
Operand B: 0b1010
Operation: XOR
Output
HEX: 6
DEC: 6
OCT: 6
BIN: 0000 0110
Unsigned: 6
Signed: 6

XOR keeps only positions where the two operands differ, then displays the masked result in every supported base.

Inspect 0.1 as a 64-bit IEEE 754 value

Input
Decimal number: 0.1
Precision: 64-bit
Output
HEX: 0x3FB999999999999A
Sign: 0
Exponent: 01111111011
Mantissa: 1001100110011001100110011001100110011001100110011010

The DataView representation exposes the finite binary approximation used for the JavaScript number 0.1.

About this tool

Low-level programming means constantly switching number bases — a value is decimal in your head, hex in the datasheet and binary when you're masking flag bits. This calculator shows a value in binary, octal, decimal and hexadecimal simultaneously and updates every representation as you type in any one of them, with a clickable bit grid so you can flip individual bits and watch the result change.

A full set of bitwise operators (AND, OR, XOR, NOT, left and right shift) computes masks and combines flags, and a selectable word size (8/16/32/64-bit) models how values wrap and how two's-complement negatives are represented on real hardware. A separate IEEE 754 inspector breaks a floating-point number into its sign, exponent and mantissa for single and double precision. Everything is computed with BigInt for exact 64-bit results, entirely in your browser.

How to use

  1. Enter a value in any base

    Type in the hex, decimal, octal or binary field — the others update instantly.

  2. Flip bits directly

    Click cells in the bit grid to toggle individual bits and see every base recalculate.

  3. Run a bitwise operation

    Enter two operands and pick AND, OR, XOR, NOT or a shift to compute a mask; results show in all bases.

  4. Inspect a float

    Use the IEEE 754 panel to see the sign, exponent and mantissa bits of a 32- or 64-bit float.

Use cases

Designing masks and flags

Combine bit fields with AND, OR, XOR, and NOT while reading the same result in binary and hexadecimal.

Checking fixed-width overflow

Switch among 8-, 16-, 32-, and 64-bit words to see how large or negative integers wrap after masking.

Translating protocol and register values

Convert values copied from decimal documentation, hexadecimal dumps, octal permissions, or binary register diagrams.

Explaining floating-point encodings

Inspect sign, exponent, mantissa, and hexadecimal layouts for 32-bit and 64-bit IEEE 754 values.

Capabilities

FeatureDetail
Multi-base viewBinary, octal, decimal, hex — all in sync
Word size8, 16, 32 or 64-bit with two's-complement wrapping
Bitwise opsAND, OR, XOR, NOT, left shift, right shift
IEEE 754Sign / exponent / mantissa for 32- and 64-bit floats
ExactnessBigInt math — no precision loss at 64 bits

All computation is client-side.

Common mistakes

Mistake:Expecting a 0x, 0b, or 0o prefix to override the field's selected base.

Fix:Enter the value in the matching HEX, BIN, or OCT field. The parser tolerates a prefix but still validates the remaining digits against the field's base.

Mistake:Reading the displayed decimal value as signed without checking the Signed line.

Fix:The synchronized DEC field is the unsigned word value. Use the separate Signed readout for the two's-complement interpretation.

Mistake:Expecting RSHIFT to preserve a negative sign bit.

Fix:Operands are masked to unsigned word values before operations, so right shift is performed on a non-negative BigInt. Model arithmetic right shift separately when sign extension is required.

Mistake:Assuming the IEEE 754 inspector performs arbitrary-precision decimal conversion.

Fix:The input is converted with JavaScript Number first and then written as Float32 or Float64. Use the inspector to examine those binary formats, not decimal arbitrary-precision math.

Frequently asked questions

References & standards