Type or paste below and get a unique color ID image specific to your exact block of text.
Any letter or symbol or emoji or anything else you can type or show on a screen is part of a big system called Unicode 🔣. In Unicode, each letter or symbol is given a unique numerical value, called a code point. The code point for the letter A is 65, while code points for some emojis are up in the 128,000+ range.
This tool takes the Unicode code point for a given letter or symbol, and multiplies it by the Knuth Multiplicative Hash Constant, 2654435761. This number is not arbitrary; it's the prime number that you get from multiplying the fractional part of the golden ratio (the .6180339... bit) by 232 (the size of a 32-bit integer space).
Then we take that result and apply modulo 256, which means we take the remainder from dividing it by 256 and only keep that number. This keeps it within the range of 0-255.
RGB values (Red, Green, and Blue values) are expressed between 0 and 255. For instance, RGB(255, 0, 0) is red, since it's like turning the red slider all the way up and keeping the green and blue sliders all the way down. Meanwhile, RGB(255, 0, 255) is purple, since it's combining a full mix of red and blue, with no green.
We take our remainder value that's always between 0-255 thanks to the modulo function, and set the red value to that number. Then we do it all over again - we multiply that number by the Knuth Multiplicative Hash Constant, then take the modulo 256 of that to get it between 0-255, then set that as the green value. Then multiply that number by the Knuth, apply modulo 256 again, and take that final value and make it our blue value.
The point of these mathematical acrobatics is to make sure that similar Unicode characters (like "abcd") don't necessarily have similar color values. We could have just started with RGB(0, 0, 1) for Unicode character 1, then went to RGB(0, 0, 2) for Unicode character 2, etc., but the differences between these colors are barely perceptible to the human eye, so for blocks of text that use mostly the same character systems (like English, which is mostly 26 uppercase letters, 26 lowercase letters, 0-9, and some punctuation), the final result would not have been very colorful at all!
With this method, however, we can convert any Unicode symbol into a specific, repeatable, and always unique color value, and ensure that there's lots of variation from symbol to symbol. And once we find the color for the first symbol, we do it for the second, third, fourth, to the last, then put them in the most convenient square shape, and fill any blank space at the end with repeating black and white tiles.
In theory, this is reverse-translatable as well. But that's for another day. Enjoy your unique text color ID block!
By Ethan Hulbert. View all tools. If you use this, send me a thank you email :)