Hex Color Code Generator

Pick or type a color — copy the hex, RGB, or HSL value.

Click to pick
Red 125
Green 219
Blue 132
About this tool

Hex Color Code Generator

Hex Code Color Generator produces random hex colours and converts between formats, with a picker and live preview.

How to use it

  1. Generate a random colour, or enter one with the picker or hex field.
  2. Read the converted values.
  3. Copy the format you need.

How a hex colour is built

A hex colour is three pairs of hexadecimal digits for red, green and blue, each running from 00 to FF, which is 0 to 255 in decimal. That gives 256 values per channel and about 16.7 million combinations.

An eight-digit hex code adds a fourth pair for alpha, where 00 is fully transparent and FF is fully opaque. Three-digit shorthand expands each digit into a pair, so #F0A is #FF00AA, which means shorthand can only express a small subset of colours.

When it helps

  • Getting a starting colour when you have no brief.
  • Converting a hex value into RGB for code that needs channels.
  • Exploring colour combinations quickly.
  • Grabbing a random colour for a placeholder or a test.

Common mistakes

  • Using random colours as a palette. Randomness produces variety, not coherence.
  • Forgetting the alpha pair position in eight-digit hex, which some tools order as ARGB rather than RGBA.
  • Assuming shorthand works for any colour. Only colours with paired digits can be shortened.
Hex Color Code Generator interface preview
Screenshot of the live Hex Color Code Generator interface.

v1.0