Generate random colors with HEX, RGB, and HSL values. Lock channels, generate palettes, and browse your color history.
Our random color generator is a useful tool for designers, developers, and anyone who needs color inspiration. Each color is generated by randomly selecting red, green, and blue values between 0 and 255, giving you access to any of the 16.7 million possible colors. Copy colors in HEX for web design, RGB for programming, or HSL for easier color manipulation. Use the channel locking feature to explore variations — lock the hue to get different shades of the same color, or lock saturation to explore colors with similar vibrancy.
A random color is generated by picking three random values (red, green, blue) each between 0 and 255. The formula is r = Math.floor(Math.random() * 256), and the same for g and b. These three values together define any of the 16.7 million possible RGB colors.
A HEX color code is a 6-digit hexadecimal representation of a color, preceded by #. Each pair of digits represents the red, green, and blue values (00–FF). For example, #FF0000 is pure red, #00FF00 is green, and #0000FF is blue. HEX codes are widely used in web design and CSS.
RGB (Red, Green, Blue) defines color by mixing three primary light colors. HSL (Hue, Saturation, Lightness) defines color more intuitively: hue is the color type (0–360 degrees on the color wheel), saturation is how vivid it is (0–100%), and lightness is how bright it is (0–100%). HSL is often easier to work with when adjusting colors.
Yes. Click "Generate palette of 5 colors" to create five random colors at once. Each color is shown as a swatch you can click to copy its HEX code. Use this for quickly exploring color combinations for design projects.
Copy the HEX value (e.g. #A3F2B1) and use it in CSS as background-color: #A3F2B1; or color: #A3F2B1;. You can also use the RGB value directly: background-color: rgb(163, 242, 177); or the HSL value: background-color: hsl(131, 82%, 79%);