Hex is for compact writing; bits are where the meaning lives. Three everyday scenes:
- Bitmask analysis. The mask
0xF0 expands to 11110000 — instantly visible: it keeps the high nibble and zeroes the low four bits. 0x01 is 00000001, the lowest bit. Reading masks in hex hides exactly the information you are looking for.
- Permission and flag registers. Unix permissions do the same trick in octal:
755 expands three bits per digit to 111 101 101, which is rwx r-x r-x. Hardware register documentation likewise lists bitfields — "bits 7:4 = mode" — and expanding the hex value shows which mode bits are set.
- Debugging bytes. A protocol dump says
0x3C; the bits 0011 1100 tell you which flags are on. Our binary to decimal converter takes over when you also need the numeric value with signed options.
One honest limit: this converter is byte-oriented, so it expects complete pairs of hex digits. A lone F fails with a precise message instead of a guess — pad it to 0F if you meant the single-digit value. And leading zeros inside a nibble are data, not decoration: 0F (15) and F0 (240) are very different bytes.
Common Mistakes
- Mistake: dropping leading zeros inside a nibble. Writing A as
101 instead of 1010 shifts every following bit. Correction: every hex digit is exactly 4 bits, zeros included — 1A is 0001 1010.
- Mistake: an odd digit count.
486 is a truncated copy, one digit short of a byte. Correction: hex bytes come in pairs — re-copy the source, or pad a leading 0 if the value was truly single-digit.
- Mistake: reading the binary output as one number when you needed bytes. Correction: check the grouping. The 8-bit view is one group per byte; the decimal line below the result shows both per-byte values and the overall number so you can tell them apart.
Practice
1. Convert 3C to binary. 3 = 0011, C = 12 = 1100 — answer: 0011 1100.
2. Convert 1010 1111 back to hex. 1010 = A, 1111 = F — answer: AF. Check it in the Binary → Hex direction above.
3. Which mask zeroes the low nibble of a byte? The high nibble stays, the low four bits are 0: 11110000 = 0xF0.