Bits

Toggle individual bits and watch the value change across binary, octal, decimal and hex at once.

Runs in your browser — nothing you type here is sent anywhere.
Value
0xDEADBEEF
32-bit
3735928559signed -559038737
Bits — click to toggle
byte 3DE.
byte 2AD.
byte 1BE.
byte 0EF.
Binary
1101 1110 1010 1101 1011 1110 1110 1111
Representations
hex0xDEADBEEF
octal0o33653337357
unsigned3735928559
signed-559038737
bytesDE AD BE EF
ascii....
Analysis
set bits24
leading zeros0
trailing zeros0
highest set bit31
power of twono
Second operand
a      1101 1110 1010 1101 1011 1110 1110 1111
b      0000 0000 0000 0000 1111 1111 1111 1111
a & b  0000 0000 0000 0000 1011 1110 1110 1111
= 0x0000BEEF

Values are masked to the chosen width, so a 32-bit shift left really does drop its high bits and negative numbers show as two's complement. Underscores and spaces are ignored, so grouped output pastes straight back in. A 0x, 0b or 0o prefix wins over the base chips unless its letter is a digit in that base — in hex, 0b1010 is the number B1010. shr copies the sign bit down; ushr feeds in zeros.

Bitmasks and flag fields are best understood by seeing them. Working out which bit a permission or feature flag sets, or why a mask is not matching, is much easier when the bits are laid out and clickable.

Click bits to flip them and every representation updates together, with shifts and the usual bitwise operations available. It is a small tool that removes a class of arithmetic mistake.

What people open it for

In the terminal

tools bits

Every utility is also a command in the desktop's shell.

More data tools

Open the full desktop, with all 47 utilities