User Rating 0.0
Total Usage 0 times
R
124 01111100
1286432168421
G
159 10011111
B
229 11100101
HEX #7C9FE5
RGB rgb(124, 159, 229)
Binary 01111100 10011111 11100101
24-bit Int 8167397
HSL hsl(220, 67%, 69%)
Is this tool helpful?

Your feedback helps us improve.

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.

color binary rgb bits binary color converter bit manipulation color visualization rgb binary

Formulas

Each RGB channel value C (where C ∈ {R, G, B}) is an unsigned 8-bit integer decomposed as:

C = 7i=0 bi 2i

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:

Color24 = R × 216 + G × 28 + B

HEX conversion maps each channel to a two-digit base-16 string: Chex = toString(C, 16).

Reference Data

Bit PositionBit WeightDecimal Value% of Channel MaxHex ContributionVisual Impact
7 (MSB)2712850.2%80Dominant shift
6266425.1%40Major shift
5253212.5%20Visible shift
424166.3%10Noticeable
32383.1%08Subtle
22241.6%04Minor
12120.8%02Barely visible
0 (LSB)2010.4%01Imperceptible
Common Color Bit Patterns
Pure RedR: 11111111, G: 00000000, B: 00000000#FF0000rgb(255,0,0)
Pure GreenR: 00000000, G: 11111111, B: 00000000#00FF00rgb(0,255,0)
Pure BlueR: 00000000, G: 00000000, B: 11111111#0000FFrgb(0,0,255)
WhiteR: 11111111, G: 11111111, B: 11111111#FFFFFFrgb(255,255,255)
BlackR: 00000000, G: 00000000, B: 00000000#000000rgb(0,0,0)
YellowR: 11111111, G: 11111111, B: 00000000#FFFF00rgb(255,255,0)
CyanR: 00000000, G: 11111111, B: 11111111#00FFFFrgb(0,255,255)
MagentaR: 11111111, G: 00000000, B: 11111111#FF00FFrgb(255,0,255)
Mid GrayR: 10000000, G: 10000000, B: 10000000#808080rgb(128,128,128)
Dark RedR: 10000000, G: 00000000, B: 00000000#800000rgb(128,0,0)
CoralR: 11111111, G: 01111111, B: 01010000#FF7F50rgb(255,127,80)
Steel BlueR: 01000110, G: 10000010, B: 10110100#4682B4rgb(70,130,180)

Frequently Asked Questions

Bit 7 (the MSB) has a weight of 27 = 128, contributing 50.2% of the channel's maximum value of 255. Bit 0 (the LSB) has a weight of 20 = 1, which is only 0.4% of the maximum. Human vision cannot reliably distinguish a single-LSB change under normal viewing conditions, but an MSB flip is immediately obvious.
Standard 24-bit color (8 bits per channel) is what this tool visualizes. Formats like PNG-48 use 16 bits per channel (65,536 levels), while indexed GIFs use a single 8-bit palette index for all three channels combined, limiting output to 256 total colors. Reducing bit depth per channel (e.g., to 5-6-5 in RGB565) is common in embedded displays and lossy compression.
Yes. Setting all bits below position N to zero is equivalent to posterization (reducing color levels to 2(8−N)). Inverting all 24 bits produces the color negative. Right-shifting each channel by 1 bit halves brightness. AND-masking a channel with 11110000 quantizes it to 16 levels, a technique used in dithering algorithms.
Consumer displays typically reproduce 6-8 bits per channel natively. A 6-bit panel uses Frame Rate Control (FRC) to simulate 8-bit depth. Changes in the two lowest bits may be indistinguishable on such hardware. Additionally, sRGB gamma encoding means perceptual brightness is nonlinear - low-value bit changes in dark regions are more visible than the same changes in bright regions.
Addressable LED protocols (WS2812B, APA102) transmit color data as a serial bitstream: 24 bits per LED in GRB or RGB order. Each bit is encoded as a timed high/low pulse. A single bit error shifts all downstream colors. Understanding the binary layout is essential for writing correct driver code on platforms like Arduino or ESP32 where you construct the color word via bitwise OR and shift operations.
Each hex digit maps exactly to 4 binary bits (a nibble). Bit positions 7-4 form the high nibble and bits 3-0 form the low nibble of each channel. For example, binary 11001010 splits into 1100 (hex C) and 1010 (hex A), giving CA. This 1:4 mapping is why hex is the preferred shorthand for binary color values - it compresses 24 binary digits into 6 hex characters without any loss of information.