Color Binary Bits
Visualize and manipulate RGB color channels as binary bits. Toggle individual bits to see how each affects the final color in real time.
About
Every color on screen is stored as three bytes: 8 bits for R, 8 bits for G, 8 bits for B. That gives 224 = 16,777,216 possible colors. A single flipped bit in the high-order position shifts a channel by 128 units. A flip in the lowest bit changes it by just 1. Misunderstanding bit weight leads to incorrect color math in shader code, embedded firmware for LED controllers, and image compression routines. This tool decomposes any color into its 24-bit binary representation and lets you toggle each bit individually to observe the exact per-channel and composite effect. It assumes standard sRGB color space with no gamma pre-compensation.
Formulas
Each RGB channel value C (where C ∈ {R, G, B}) is an unsigned 8-bit integer decomposed as:
where bi ∈ {0, 1} is the bit at position i. The most significant bit (MSB) is b7 with weight 128. The least significant bit (LSB) is b0 with weight 1.
The full 24-bit color integer is computed as:
HEX conversion maps each channel to a two-digit base-16 string: Chex = toString(C, 16).
Reference Data
| Bit Position | Bit Weight | Decimal Value | % of Channel Max | Hex Contribution | Visual Impact |
|---|---|---|---|---|---|
| 7 (MSB) | 27 | 128 | 50.2% | 80 | Dominant shift |
| 6 | 26 | 64 | 25.1% | 40 | Major shift |
| 5 | 25 | 32 | 12.5% | 20 | Visible shift |
| 4 | 24 | 16 | 6.3% | 10 | Noticeable |
| 3 | 23 | 8 | 3.1% | 08 | Subtle |
| 2 | 22 | 4 | 1.6% | 04 | Minor |
| 1 | 21 | 2 | 0.8% | 02 | Barely visible |
| 0 (LSB) | 20 | 1 | 0.4% | 01 | Imperceptible |
| Common Color Bit Patterns | |||||
| Pure Red | R: 11111111, G: 00000000, B: 00000000 | #FF0000 | rgb(255,0,0) | ||
| Pure Green | R: 00000000, G: 11111111, B: 00000000 | #00FF00 | rgb(0,255,0) | ||
| Pure Blue | R: 00000000, G: 00000000, B: 11111111 | #0000FF | rgb(0,0,255) | ||
| White | R: 11111111, G: 11111111, B: 11111111 | #FFFFFF | rgb(255,255,255) | ||
| Black | R: 00000000, G: 00000000, B: 00000000 | #000000 | rgb(0,0,0) | ||
| Yellow | R: 11111111, G: 11111111, B: 00000000 | #FFFF00 | rgb(255,255,0) | ||
| Cyan | R: 00000000, G: 11111111, B: 11111111 | #00FFFF | rgb(0,255,255) | ||
| Magenta | R: 11111111, G: 00000000, B: 11111111 | #FF00FF | rgb(255,0,255) | ||
| Mid Gray | R: 10000000, G: 10000000, B: 10000000 | #808080 | rgb(128,128,128) | ||
| Dark Red | R: 10000000, G: 00000000, B: 00000000 | #800000 | rgb(128,0,0) | ||
| Coral | R: 11111111, G: 01111111, B: 01010000 | #FF7F50 | rgb(255,127,80) | ||
| Steel Blue | R: 01000110, G: 10000010, B: 10110100 | #4682B4 | rgb(70,130,180) | ||