🔍

HEX/RGB Color Generator – Generate random colors in HEX, RGB, and HSL formats

Generate random colors in HEX, RGB, and HSL formats

How to Use This Tool

Generate a color, then copy the color value for use in CSS, design tools, or branding drafts.

When Should You Use This Tool?

Use this when you need quick color ideas or a random palette starting point.

See also: Random Name Generator, Random Number .

What is a Random Color Generator?

A Random Color Generator creates colours at random and displays them in multiple formats simultaneously — HEX, RGB, and HSL. Each generated colour shows you its exact values so you can copy them straight into CSS, design tools like Figma or Adobe XD, or any application that accepts colour codes.

HEX, RGB, and HSL Explained

  • HEX (#RRGGBB): The most common format in web development. A six-character code representing the red, green, and blue components in hexadecimal. Used directly in CSS, HTML, and most design tools.
  • RGB (Red, Green, Blue): Specifies colour as three values from 0–255 for each channel. Useful in CSS (rgb()) and programming contexts where you need numeric channels.
  • HSL (Hue, Saturation, Lightness): An intuitive model where hue is a degree on the colour wheel (0–360), saturation is the intensity (0–100%), and lightness is how light or dark the colour is. Great for programmatic colour adjustments.

When to Use a Random Color Generator

  • Design exploration: Break out of your usual colour habits and discover unexpected combinations
  • Palette starting point: Use a generated colour as an anchor and build a palette around it
  • Placeholder colours: Quickly fill UI mockups or prototypes with distinct colours during development
  • Data visualisation: Generate a set of distinct colours for chart series, map regions, or graph nodes
  • Game development: Assign random colours to characters, teams, or game objects
  • Creative projects: Find inspiration for illustrations, branding experiments, or art projects

Tips for Working with Generated Colours

  • Generate a larger batch (10–20) and pick the ones that resonate — random colours often cluster into interesting groupings
  • If you need a cohesive palette, pick one HEX value and adjust its HSL lightness and saturation in your design tool
  • Check colour contrast ratios before using generated colours for text — use a contrast checker to meet WCAG accessibility standards
  • Very dark or very light colours are harder to distinguish; if accessibility matters, aim for saturation and lightness in the mid-range

Frequently Asked Questions

How many colours can I generate at once?
You can generate between 1 and 20 colours at a time. Set the number in the input field before clicking Generate.
Are the colours truly random?
Yes. Each colour's red, green, and blue channels are generated independently using JavaScript's random number generator, giving you access to the full ~16.7 million possible RGB colours.
How do I copy a colour value?
Click on any colour value displayed below the colour swatch to copy it to your clipboard instantly.
What is the difference between HSL and HSB/HSV?
HSL and HSB (also called HSV) are similar but different. In HSL, a lightness of 100% always gives white regardless of hue or saturation. In HSB, a brightness of 100% gives a vivid colour (not white). This tool uses HSL, which is the standard used in CSS.
Can I use these colours commercially?
Yes. Colour values are not copyrightable. Any colour generated here is completely free to use in personal or commercial projects.