A random color generator creates colors and five-color palettes at the press of a button. Each color shows its HEX, RGB and HSL values, the nearest named color and a contrast check against white and black text. Lock the colors you like, regenerate the rest, and copy values or CSS.
Last updated: 26 October 2026
hsl(257, 39%, 34%)
Nearest: indigo
White text: 10.19:1
Black text: 2.06:1
hsl(11, 46%, 49%)
Nearest: sienna
White text: 4.67:1
Black text: 4.50:1
hsl(56, 79%, 32%)
Nearest: olive
White text: 3.62:1
Black text: 5.81:1
hsl(276, 86%, 46%)
Nearest: slateblue
White text: 6.67:1
Black text: 3.15:1
hsl(216, 89%, 44%)
Nearest: royalblue
White text: 6.00:1
Black text: 3.50:1
Sample palette shown. Lock a color to keep it when you generate again. Contrast uses the WCAG formula.
How to use the random color generator
Choose a mode and press Generate palette. Any color draws from the full range, pastel gives soft light colors, vivid gives strong saturated ones, and dark gives deep colors for backgrounds. Tick Lock under a swatch to keep it while the others change. Use the HEX, RGB and HSL buttons to copy a single value, Copy all HEX to copy the palette as a list, or Copy CSS variables to paste five custom properties straight into a stylesheet.
Colors are generated in your browser and nothing is sent to a server. The palette is not saved, so copy what you want before you leave the page.

Random hex color, RGB and HSL explained
A hex color is a hash sign followed by six hexadecimal digits: two for red, two for green and two for blue, each from 00 to FF. The same color as RGB gives those three channels as numbers from 0 to 255. HSL describes a color by hue, an angle from 0 to 360 on the color wheel, plus saturation and lightness as percentages. HSL is the easiest format to adjust by hand: raise the lightness for a tint, lower it for a shade, and shift the hue to move around the wheel. All three describe the same color, so use whichever your tool expects.
Random color palette generator tips
A good palette has a few strong colors and a few quiet ones. Lock a color you love, generate again in pastel mode to find soft companions, and use a dark swatch for text or backgrounds. Aim for one dominant color, one or two supporting colors and a neutral. If every swatch is equally loud, nothing stands out. Test the palette on a real layout before you commit to it. To label a finished palette for a project, a random name generator gives each set a short name. To label a finished palette, a random username generator can suggest a short handle for the set.
Checking color contrast for text
Each swatch shows its contrast ratio with white and with black text, calculated with the WCAG formula. The thresholds below are the ones used in the Web Content Accessibility Guidelines. A color that scores below 4.5 to 1 with white text should not carry small white text, and may need a darker shade. Contrast helps readers with low vision and anyone reading on a bright screen.
| Level | Normal text | Large text | Graphics and interface parts |
|---|---|---|---|
| AA (minimum) | 4.5 : 1 | 3 : 1 | 3 : 1 |
| AAA (enhanced) | 7 : 1 | 4.5 : 1 | Not specified |
| Large text means | Under 18 pt regular | At least 18 pt, or 14 pt bold | Icons, borders, focus rings |
Common named colors with HEX and RGB values
The nearest-name label on each swatch comes from this list of standard CSS color names. Tap Copy to take the HEX value of any of them. More free utilities are on the SoShareIT Tools home page.
| Color | Name | HEX | RGB |
|---|---|---|---|
| black | #000000 | 0, 0, 0 | |
| white | #FFFFFF | 255, 255, 255 | |
| red | #FF0000 | 255, 0, 0 | |
| lime | #00FF00 | 0, 255, 0 | |
| blue | #0000FF | 0, 0, 255 | |
| yellow | #FFFF00 | 255, 255, 0 | |
| cyan | #00FFFF | 0, 255, 255 | |
| magenta | #FF00FF | 255, 0, 255 | |
| silver | #C0C0C0 | 192, 192, 192 | |
| gray | #808080 | 128, 128, 128 | |
| maroon | #800000 | 128, 0, 0 | |
| olive | #808000 | 128, 128, 0 | |
| green | #008000 | 0, 128, 0 | |
| purple | #800080 | 128, 0, 128 | |
| teal | #008080 | 0, 128, 128 | |
| navy | #000080 | 0, 0, 128 | |
| orange | #FFA500 | 255, 165, 0 | |
| pink | #FFC0CB | 255, 192, 203 | |
| brown | #A52A2A | 165, 42, 42 | |
| gold | #FFD700 | 255, 215, 0 | |
| coral | #FF7F50 | 255, 127, 80 | |
| salmon | #FA8072 | 250, 128, 114 | |
| tomato | #FF6347 | 255, 99, 71 | |
| crimson | #DC143C | 220, 20, 60 | |
| orchid | #DA70D6 | 218, 112, 214 | |
| violet | #EE82EE | 238, 130, 238 | |
| indigo | #4B0082 | 75, 0, 130 | |
| turquoise | #40E0D0 | 64, 224, 208 | |
| skyblue | #87CEEB | 135, 206, 235 | |
| royalblue | #4169E1 | 65, 105, 225 | |
| steelblue | #4682B4 | 70, 130, 180 | |
| khaki | #F0E68C | 240, 230, 140 | |
| beige | #F5F5DC | 245, 245, 220 | |
| ivory | #FFFFF0 | 255, 255, 240 | |
| lavender | #E6E6FA | 230, 230, 250 | |
| plum | #DDA0DD | 221, 160, 221 | |
| chocolate | #D2691E | 210, 105, 30 | |
| sienna | #A0522D | 160, 82, 45 | |
| tan | #D2B48C | 210, 180, 140 | |
| forestgreen | #228B22 | 34, 139, 34 | |
| seagreen | #2E8B57 | 46, 139, 87 | |
| limegreen | #32CD32 | 50, 205, 50 | |
| mintcream | #F5FFFA | 245, 255, 250 | |
| slategray | #708090 | 112, 128, 144 | |
| darkslategray | #2F4F4F | 47, 79, 79 | |
| firebrick | #B22222 | 178, 34, 34 | |
| hotpink | #FF69B4 | 255, 105, 180 | |
| deeppink | #FF1493 | 255, 20, 147 | |
| darkorange | #FF8C00 | 255, 140, 0 | |
| goldenrod | #DAA520 | 218, 165, 32 | |
| chartreuse | #7FFF00 | 127, 255, 0 | |
| springgreen | #00FF7F | 0, 255, 127 | |
| aquamarine | #7FFFD4 | 127, 255, 212 | |
| dodgerblue | #1E90FF | 30, 144, 255 | |
| midnightblue | #191970 | 25, 25, 112 | |
| slateblue | #6A5ACD | 106, 90, 205 | |
| peachpuff | #FFDAB9 | 255, 218, 185 | |
| wheat | #F5DEB3 | 245, 222, 179 | |
| linen | #FAF0E6 | 250, 240, 230 | |
| snow | #FFFAFA | 255, 250, 250 |

Random color generator FAQ
How do I generate a random hex color?
Press Generate. Each swatch gets a random color shown as a six-digit hex code such as #3a7bd5, together with its RGB and HSL values. Copy any value with one tap.
What does locking a color do?
A locked swatch keeps its color when you press Generate again, so you can build a palette around a color you like and let the other four change.
How is the contrast ratio calculated?
The tool uses the WCAG formula. It converts each color to relative luminance and divides the lighter value plus 0.05 by the darker value plus 0.05. A ratio of 4.5 to 1 passes AA for normal text and 3 to 1 passes AA for large text.
What do pastel, vivid and dark modes change?
They limit the saturation and lightness the generator may pick. Pastel gives soft light colors, vivid gives strong saturated colors, and dark gives deep colors that suit backgrounds.