go-supertools
Developer & Data Tools

RGB to Hex

Convert RGB to Hex Colors

Runs in your browser Your input never leaves your device.

HEX—
RGB—
HSL—

Report a problem with this tool

About this tool

Converts an RGB color to a hex code and shows the same color as HEX, RGB and HSL together with a live swatch. Type a value such as rgb(76, 63, 242) or just 76, 63, 242, or choose a color with the picker. Hex and hsl() values are accepted too, so you can convert in either direction. Each channel is limited to 0-255, with higher numbers set to 255. A fourth alpha value in rgba() is ignored, and the hex output is always six digits without transparency. Each result has a copy button. Conversion is done in your browser.

How to use it

  1. Enter RGB values, for example rgb(76, 63, 242), or pick a color.
  2. Read the hex code in the HEX row.
  3. Press copy to use it in your CSS.

Example

Input
rgb(76, 63, 242)
Result
#4c3ff2

Common problems

Nothing changes after typing
The input is not recognized. Use three numbers from 0 to 255, such as 76, 63, 242.
Transparency is lost
The alpha value in rgba() is ignored and hex output has no alpha digits.
A number above 255 is changed
Channels are capped at 255, so 300 becomes 255.