Colored Squares Cipher

Map hex colors to alphabet letters. Encode messages as visual color blocks, decode color sequences back to text.

Text to Encode
Hex Codes
Type text to encode it as colored squares.

How the Colored Squares Cipher Works

This visual cipher replaces each letter of the alphabet with a specific color. The encoded message becomes a row of colored squares — visually appealing and impossible to read without the color key. The default mapping uses a carefully chosen palette of 26 distinct colors, one per letter. Spaces in the original text appear as thin gaps between groups of squares.

The cipher is inspired by color-based steganography and visual cryptography. While it is not mathematically secure, it serves as an excellent educational tool for exploring substitution ciphers, and creates beautiful visual outputs that work well for puzzles, games, and art projects.

Visual Cryptography and Color Codes

Visual cryptography is a branch of cryptography where secrets are encoded in visual elements — images, patterns, colors, or spatial arrangements — rather than purely mathematical operations. Color-based encoding has been used in various forms throughout history, from colored lanterns used as signals to modern QR codes where color variations encode data. This tool uses hex color codes — the standard 6-digit RGB representation used in web design and digital art — as the encoding alphabet.

The Default Color Palette

The 26 colors in the default map are chosen to be visually distinct from one another, making manual decoding possible if you memorize key colors. High-frequency letters like E, T, A get bold distinctive colors. The full palette is visible in the Custom Map tab. The colors are drawn from a rainbow-spread selection that ensures no two adjacent letters look similar.

Custom Color Maps

Switch to the Custom Map tab to define your own letter-to-color mapping as a JSON object. This makes the cipher significantly harder to decode without the key — since the color sequence itself gives no information about the underlying mapping. Share only the key with your intended recipient. You can use any valid hex color, including dark and light shades, pastels, and neons.

Applications

  • Escape rooms — hide a code word in a grid of colored squares
  • Educational cryptography — teach substitution ciphers visually
  • Art and design — generate color sequences from text for design inspiration
  • Puzzle books — create color-coded puzzle challenges

Frequently Asked Questions

Each letter A–Z maps to a specific hex color. Encoding converts text to colored squares. Decoding takes a sequence of hex codes and looks them up in the color map to retrieve letters.
Yes. Switch to the Custom Map tab and edit the JSON to assign any hex color to each letter. Your custom map is applied immediately to encoding and decoding.
Switch to Decode mode and enter hex codes (like #FF5733) separated by spaces. Each code is matched to its letter using the color map. Unknown colors show as '?'.
Standard 6-digit hex #RRGGBB format. The # prefix is optional when decoding. Both uppercase and lowercase are accepted.
No — it is a fun visual tool, not a security tool. Use AES encryption for real secrets.