Developer Calculator
Base conversion and bitwise calculator.
1111 1111377255ff255255Bitwise operation
0x000000What is Developer Calculator?
Developer Calculator is a free programmer's calculator that converts numbers between binary, octal, decimal, and hex, and runs bitwise operations the way a CPU does. Pick a bit width of 8, 16, 32, or 64 and see signed and unsigned two's-complement views, with everything computed in your browser.
Key features
- Converts one value to binary, octal, decimal, and hex at once
- Bit widths of 8, 16, 32, or 64 with two's-complement wrapping
- Signed and unsigned interpretations shown side by side
- AND, OR, XOR, NOT, and shift operations with operand B
- Accepts underscore separators (1_000) and negative values
Developer Calculator — base conversion & bitwise math
A programmer's calculator does two jobs a regular one can't: it shows the same number in binary, octal, decimal, and hex simultaneously, and it does bitwise math inside a fixed register width the way a real CPU does — wrapping, sign bits and all. This tool does both, entirely in your browser, using arbitrary-precision integers so even 64-bit values stay exact.
Reading a value in every base
Set the input base (binary, octal, decimal, or hex), then type a value. Every field updates at once. A few input conveniences:
- Underscores are ignored, so
1_000_000and0xFF_FFare fine — handy for making long binary strings readable. - A leading
-is accepted for negative decimals. - A matching base prefix is stripped automatically:
0xin hex mode,0bin binary,0oin octal.
Invalid characters for the chosen base (a 2 in binary mode, a g in hex) simply show an "invalid" note rather than guessing.
Why the bit width changes the answer
Below the conversions, pick a bit width — 8, 16, 32, or 64. This is the size of an imaginary register the value is poured into, and it decides the signed interpretation via two's complement. The classic example: enter 255. At 32-bit it reads 255 signed and 255 unsigned. Switch to 8-bit and the unsigned view stays 255, but the signed view becomes -1 — because in a single byte, 11111111 has its top bit set, marking it negative. Changing the width doesn't change the bits; it changes how the top bit is read.
Bitwise operations that wrap like hardware
Choose an operation — AND, OR, XOR, NOT, shift-left (SHL), or shift-right (SHR) — and, for everything except NOT, a second operand B. NOT is unary, so its operand field disappears. The result is shown three ways: hex, decimal, and binary grouped into readable chunks.
Everything is masked to the selected width, which is the whole point. NOT 0 at 8-bit is 255 (0xFF), but at 32-bit it's 4294967295 (0xFFFFFFFF) — the same operation, a different register size. 1 SHL 4 gives 16; shift far enough left and the high bits fall off the end of the register instead of growing the number, exactly like << on a fixed-size integer in C, Rust, or Go. This makes the tool useful for reasoning about flag masks, packing fields into a word, or checking why a shift overflowed in your code.
A common gotcha
Operand B is parsed in the same base as your main input. If you're in hex mode and want to AND with decimal 12, either switch to decimal first or type 0xC. Likewise, shift amounts are read in the current base — an easy thing to trip over when you leave the tool set to hex.
Privacy
Every conversion and bitwise operation is plain local arithmetic on numbers you type. Nothing is sent to a server, so you can safely paste values from private systems.
Frequently asked questions
- Why does 255 show as -1 in the signed row?
- Because the signed value depends on the bit width. At 8-bit, 255 is 11111111 with the top bit set, which two's complement reads as -1; the unsigned view still shows 255. Switch the width to 16, 32, or 64-bit and the same 255 reads as 255 signed, since the sign bit is no longer set.
- Can I paste values with 0x prefixes or underscores?
- Yes. Underscores are ignored everywhere (1_000_000, 0xFF_FF), and a matching base prefix is stripped automatically — 0x in hex mode, 0b in binary, 0o in octal. A leading minus sign is also accepted for negative decimals.
- In hex mode, is operand B also read as hex?
- Yes — operand B and shift amounts are parsed in whatever base your main input is set to. So in hex mode, to AND with decimal 12 you'd either switch to decimal first or type 0xC. Forgetting this is the most common source of unexpected results.
- How does the NOT operation work?
- NOT is unary, so its operand B field disappears when you select it. It inverts every bit within the chosen width: NOT 0 is 255 (0xFF) at 8-bit but 4294967295 (0xFFFFFFFF) at 32-bit — same operation, different register size.
- Is 64-bit math exact, or does it lose precision?
- It's exact. All conversions and bitwise ops run on arbitrary-precision BigInt values, then mask to the selected width, so 64-bit results don't suffer the floating-point rounding a normal calculator would introduce. Bits shifted past the register width simply fall off, exactly like << and >> on fixed-size integers in C, Rust, or Go.
Privacy
Every conversion and bitwise operation is plain local arithmetic in your browser; nothing you enter is sent to a server.
