Random Color Generator

Generate random colors from the full color wheel or from curated palettes like pastels, neons, primary colors and more. Pick 1 to 20 colors at once.

runs locally on your browser. Your data never leaves your device.

How many colors

Palette mode

Common Use Cases

Generate a set of pastel background colors for cards or sections in a UI mockup
Pick random neon accent colors for a creative coding or generative art project
Create a quick 5-color palette with locked favorites and regenerate until the combination feels right
Export random CSS custom properties to drop into a prototype stylesheet for rapid visual experimentation

About Random Color Generator

Random color generation is one of the most common micro-tasks in design and front-end development. Designers reach for a random color when they need a quick placeholder swatch for a wireframe, a starting point for an accent palette, or a burst of visual variety in a generative art piece. Developers use random colors to assign distinct hues to chart series, tag categories, avatar backgrounds, or debug bounding boxes. In creative coding frameworks like p5.js and Processing, randomising color is often the very first experiment a learner tries.

Most "random color" generators on the web produce a single fully random hex code, but fully random means a high chance of muddy browns, dull greys, and clashing tones. Constraining randomness to a curated palette mode produces far more usable results. Pastel mode restricts output to high-lightness, low-saturation hues that feel soft and approachable, ideal for backgrounds, cards, and light UI surfaces. Neon mode pushes saturation to the maximum for eye-catching accents. Dark mode keeps lightness low for deep, rich tones suited to dark-themed interfaces. Primary and secondary modes limit hues to the classic color-theory primaries (red, blue, yellow) or the six-color wheel (adding green, orange, purple), which is useful for children's apps, educational materials, and bold graphic design.

Warm and cool modes filter the hue wheel into its emotional halves: warm colors (reds, oranges, yellows) feel energetic and inviting, while cool colors (blues, greens, purples) feel calm and professional. Grayscale mode strips hue entirely, producing a spectrum from near-black to near-white, useful for neutral UI palettes, typography, and monochrome design.

This tool generates 1 to 20 colors at once, displays each as a large swatch with its HEX, RGB, and HSL values, and lets you lock individual colors so they survive when you regenerate the rest. One-click copy for individual swatches, bulk copy as comma-separated HEX, or export as CSS custom properties makes it effortless to move your colors into code. All generation uses Math.random() and HSL arithmetic, with no external libraries, no server calls, and no data leaving your browser.

Frequently Asked Questions

How does the palette mode affect which colors are generated?
Each palette mode constrains the HSL (Hue, Saturation, Lightness) parameters that are randomised. 'Any color' uses the full hue wheel with moderate saturation and lightness. 'Pastel only' forces high lightness (75–90%) and low saturation (30–60%). 'Neon / Vivid only' forces maximum saturation (90–100%) and mid-lightness. 'Dark / Deep only' keeps lightness between 10% and 30%. 'Primary colors' limits hues to red (0°), yellow (60°), and blue (240°). Other modes similarly restrict the hue and saturation ranges to match their theme.
What does locking a color do?
When you click the lock icon on a swatch, that color is preserved when you click Generate again. All unlocked swatches get new random colors, but locked ones stay exactly as they are. This lets you build a palette iteratively: lock a color you like and keep regenerating until the remaining slots look right.
Is the randomness truly uniform?
The tool uses JavaScript's Math.random(), a pseudo-random number generator (PRNG). Within the constraints of each palette mode, the hue, saturation, and lightness values are drawn uniformly from their allowed ranges. This is not cryptographically secure randomness, but it is more than adequate for generating design colors.
Can I copy all colors at once?
Yes. The 'Copy all HEX' button copies every swatch's hex value as a comma-separated list (e.g. '#A3E4D7, #F39C12, #8E44AD'). The 'Copy as CSS variables' button copies them as ready-to-paste CSS custom properties (--color-1, --color-2, etc.).
Is any data sent to a server?
No. All color generation happens entirely in your browser using Math.random() and HSL-to-RGB conversion math. Nothing is transmitted, logged, or stored. The tool works fully offline once the page has loaded.