Hex Color Difference Calculator
Measure how different two hex colors are using the redmean weighted distance formula — a fast, accurate approximation of perceptual difference.
How Hex Color Difference Is Calculated
This tool uses the redmean formula, a weighted Euclidean distance between two colors' RGB channels. Instead of treating red, green, and blue as equally important like a naive 3D distance would, redmean scales each channel's contribution based on the pair's average red value — a simple correction that noticeably improves how well the result matches human color perception, without the complexity of a full CIE Delta-E calculation.
Hex Color Difference Example, Step by Step
#2563EB vs #FF0000 = 543.4 (67.4%)
#2563EB vs #FF0000 = 543.4 (67.4% of maximum difference)
#2563EB -> rgb(37, 99, 235) #FF0000 -> rgb(255, 0, 0) ΔR=218, ΔG=-99, ΔB=-235 redmean = weighted sqrt(ΔR², ΔG², ΔB²) using avg red Result: 543.4 -> 67.4% of max (≈806)
| Step | Description | Result |
|---|---|---|
| Convert both hex colors to RGB | #2563EB -> (37,99,235), #FF0000 -> (255,0,0) | two RGB triples |
| Find channel differences | subtract each channel pairwise | ΔR=218, ΔG=-99, ΔB=-235 |
| Apply redmean weighting | weight each squared difference by average red | weighted sum |
| Take the square root | sqrt of the weighted sum | 543.4 |
| Express as a percentage | 543.4 / max possible distance | 67.4% |
The maximum possible redmean distance (black vs white) is used as the denominator, so every result is comparable on a consistent 0-100% scale regardless of which colors you're comparing.
Common Mistakes With Hex Color Difference
- Assuming a 0% difference means the colors are merely similar — it specifically means they're pixel-identical.
- Comparing the raw distance number across different tools — redmean, CIE76, and CIE2000 all produce different scales, so only compare values from the same formula.
- Expecting the percentage to be linear with visual perception at every range — it's a much closer approximation than plain RGB distance, but still not a full perceptual model like CIEDE2000.
Frequently Asked Questions
How is color difference calculated here?
Using the 'redmean' formula — a weighted Euclidean distance between the RGB channels of both colors, where the weight applied to each channel depends on the average red value. It's a well-documented approximation that tracks human color perception more closely than treating RGB as a plain 3D distance.
What's the difference between #2563EB and #FF0000?
543.4, or 67.4% of the maximum possible difference — a substantial difference, as expected between a blue and a red.
What does 0% difference mean?
Identical colors return a difference of 0 (0%) — comparing #2563EB against itself gives exactly 0.
What's the maximum possible difference?
Pure black (#000000) versus pure white (#FFFFFF) produces the maximum distance, shown as 100% — every other color pair falls somewhere below that.
Why use redmean instead of plain RGB Euclidean distance?
Plain Euclidean distance treats red, green, and blue as equally significant to perception, which they aren't. Redmean weights the channels based on the pair's average red value, giving a result that lines up better with how different two colors actually look, without the heavier computation of full CIE Delta-E.