Skip to the tool
Binary Translator Free tools

Bit workbench

Click any bit to flip it. See the value as unsigned, signed, hex and octal, and the bytes in both byte orders. Type an IPv4 address for IP to binary.

Updated · Written and checked by Murugan Vellaichamy

Waiting for input
Try:

Byte order: big-endian and little-endian

A number wider than one byte has to be stored as several bytes, and systems disagree on the order. Big-endian stores the most significant byte first; network protocols use it, which is why it’s called network byte order. Little-endian stores the least significant byte first; Intel’s x86 processors work that way. The endianness guide explains both.

So 0x12345678 is stored as 12 34 56 78 in big-endian and 78 56 34 12 in little-endian. “Swap bytes” flips between the two.

The operations

ButtonWhat it does8-bit example
NOTFlips every bit10010110 → 01101001
Shift leftMoves bits left, adds a 0 on the right10010110 → 00101100
Shift rightMoves bits right, adds a 0 on the left10010110 → 01001011
Rotate leftMoves bits left; the top bit wraps to the right10010110 → 00101101
Rotate rightMoves bits right; the bottom bit wraps to the left10010110 → 01001011
Swap bytesReverses the byte order (16 bits and up)0x1234 → 0x3412

On our other sites

Sources and method

Byte order is shown both ways: big-endian puts the most significant byte first, little-endian the least significant first. All operations use exact whole-number arithmetic masked to the chosen width.

An IPv4 address is read as four bytes, most significant first, which gives a 32-bit number. Dotted decimal (such as 192.168.1.1) is the usual way of writing those four bytes.

Questions

What does “signed” mean here?

The same bits read as two’s complement, where the top bit counts as negative. At 8 bits, 11111111 is 255 unsigned and −1 signed.

Can I type a negative number?

Yes. −1 at 16 bits shows all sixteen bits set, which is how the number is stored.

What’s the difference between a shift and a rotate?

A shift drops the bit that falls off the end and fills in a 0. A rotate puts the bit that falls off back in at the other end, so no bits are lost.

More converters

Copied