Hex Color Code Text Encoder

Encode text bytes as CSS hex color codes

Ad placeholder (leaderboard)

This tool turns any string into a list of CSS hex colour codes and back again. It is a playful way to hide a short message inside a colour palette, build colour-coded test data, or understand how bytes map onto the red, green and blue channels of #RRGGBB.

How it works

Encoding reads the UTF-8 bytes of your text and groups them three at a time. Each triplet becomes one colour: the first byte is red, the second green, and the third blue. Each byte is written as two hex digits, so the three bytes form a standard six-digit colour such as #476572. If the byte count is not a multiple of three, the last group is padded with 0x00 bytes to fill the missing channels.

Decoding reverses this. Every six-digit hex token is split back into three bytes, all the bytes are concatenated, trailing zero padding is removed, and the result is decoded as UTF-8 text.

Example and notes

The string Gera is four bytes: 0x47 0x65 0x72 0x61. Grouped in threes that is 47 65 72 and then 61 00 00, producing:

#476572 #610000

Because the encoder pads with zero bytes and the decoder strips trailing zeros, a real 0x00 at the very end of your text would be lost. For ordinary printable text this never happens. Everything runs locally, so your data never leaves the page.

Ad placeholder (rectangle)