Home / Design tools / Random RGB color

Random RGB Color Generator

Generate random RGB colors in the syntax you need: CSS rgb(), rgba(), the modern space syntax, plain numbers, an array or percentages.

or press the space bar

Colors

List

Random RGB colors in any format

An RGB color is made of three numbers from 0 to 255 for red, green and blue. Press Generate to get a list of random colors, choose how many you want, and pick the format that matches where you will use them.

FormatExampleUse
rgb(r, g, b)rgb(58, 123, 213)CSS, the classic form
rgb(r g b)rgb(58 123 213)CSS, modern form with spaces
rgba(r, g, b, a)rgba(58, 123, 213, 0.6)CSS with transparency
rgb(r g b / a%)rgb(58 123 213 / 60%)CSS, modern form with transparency
r, g, b58, 123, 213Plain numbers for code and APIs
[r, g, b][58, 123, 213]An array to paste into JavaScript or Python
rgb(r%, g%, b%)rgb(23%, 48%, 84%)CSS with percentages

Random transparency

The two formats with an alpha value add a random opacity between 0.1 and 1, so you can see how colors look when they are partly see-through. The swatches are drawn over a checked background to show the transparency.

Style and hue

By default each of the three numbers is chosen at random, which gives any color. If you want a certain look, choose a style such as pastel, dark or vivid, or a hue such as blue or green. The generator then picks colors from that range and converts them to RGB.

How the numbers are chosen

The random numbers come from your browser secure random number generator, and the choice avoids the small bias that a simple remainder calculation can add, so every value from 0 to 255 is equally likely.

Copying

Click Copy all to copy the whole list, one color per line. Click a swatch to copy just that color. Nothing is sent to a server.

For hex codes, use the random hex color generator. For a single color with its HSL and CMYK values, use the random color generator, and for harmonious sets, the random palette generator.

Frequently asked questions

How do I generate a random RGB color?

Press Generate. The tool picks a random number from 0 to 255 for red, green and blue and writes it in the format you chose.

What is the difference between rgb() and rgba()?

rgba() adds a fourth value, alpha, for transparency from 0 (invisible) to 1 (solid). Modern CSS also allows alpha in rgb() after a slash.

Can I get RGB values as an array?

Yes. Choose the [r, g, b] format and paste the list into your code.

Are the colors truly random?

They come from your browser secure random number generator, and every value from 0 to 255 is equally likely.