HEX Color Generator

← Image & Design Tools

Create or validate a HEX color and see its RGB and HSL equivalents.

ColorDesignBrowser processing

Use #RGB or #RRGGBB.

HEX: #4F46E5

How HEX colors work

HEX colors store red, green and blue channel values using hexadecimal notation. Six-digit HEX uses two characters per RGB channel.

Privacy

Color generation and conversion run entirely in your browser.

Related tools

Choose a color and copy its HEX value

  1. Select Random HEX to generate an opaque color, or enter your own three- or six-digit HEX value.
  2. Select Show Color to validate the entry and see a swatch, RGB channels and rounded HSL values.
  3. Select Copy HEX to copy the normalized, uppercase six-digit code. If clipboard access is unavailable, select the HEX value in the result and copy it manually.

A leading # is optional when entering a color. For example, f53 and #F53 both expand to #FF5533, with RGB channels 255, 85 and 51. Six-digit #000000 is black and #FFFFFF is white. Letters A–F represent hexadecimal digits; letters such as G are not valid.

What a random color does—and does not—give you

Random HEX generates red, green and blue channel values for a single color. It is useful for exploring swatches and getting a starting point for a design. It does not generate a coordinated palette or check whether text is readable on that background. Test your foreground and background together with the Color Contrast Checker before using the color for text.

Can I enter a HEX color with transparency?

This generator accepts opaque #RGB and #RRGGBB colors. To interpret four- or eight-digit values with an alpha channel, use the HEX to RGB Converter. An unsupported longer code is rejected rather than shortened to a different color.

Why are the HSL numbers rounded?

The displayed hue, saturation and lightness are rounded to whole numbers for readability. A conversion back from those rounded HSL values may differ slightly from the original RGB channels. Copy the HEX result when you need the original color.

Why is Copy HEX disabled after I edit the input?

The previous preview and copy value are cleared so they cannot be mistaken for the edited color. Select Show Color to validate the new entry, or select Random HEX for a new result.

If you already know the red, green and blue channel values, use the RGB Color Generator. To combine colors into a CSS background, try the CSS Gradient Generator.