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.
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
| Button | What it does | 8-bit example |
|---|---|---|
| NOT | Flips every bit | 10010110 → 01101001 |
| Shift left | Moves bits left, adds a 0 on the right | 10010110 → 00101100 |
| Shift right | Moves bits right, adds a 0 on the left | 10010110 → 01001011 |
| Rotate left | Moves bits left; the top bit wraps to the right | 10010110 → 00101101 |
| Rotate right | Moves bits right; the bottom bit wraps to the left | 10010110 → 01001011 |
| Swap bytes | Reverses the byte order (16 bits and up) | 0x1234 → 0x3412 |
On our other sites
- cidrcalculator.net: For subnets and IP ranges, it works out CIDR blocks, masks and address ranges.
Sources and method
- W3C WebAssembly Core Specification, overview: integers are read as unsigned or as signed in two’s complement representation. Checked 2026-11-25.
- RFC 791 (STD 5), Internet Protocol, section 2.3: an internet address is four octets (32 bits). Checked 2026-11-25.
- RFC 791 (STD 5), Internet Protocol, Appendix B, Data Transmission Order: the most significant octet of a multi-octet number is sent first. Checked 2026-11-25.
- Intel 64 and IA-32 Architectures Software Developer’s Manual, Volume 1 (253665-084US, June 2024), section 1.3.1: the processors are little-endian. Checked 2026-11-25.
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.