RGB to HEX Converter

Convert RGB values to HEX color codes instantly, including alpha for 8-digit hex. Live preview, color picker and copy-ready HEX, RGB and HSL values.

All formats
HEX#5B2B82
RGBrgb(91, 43, 130)
HSLhsl(273, 50%, 34%)

Runs locally in your browser. Nothing you enter is uploaded.

How to convert RGB to HEX

  1. Enter the red, green and blue values (0–255), and optionally alpha (0–1).
  2. Or pick a color with the color picker.
  3. The HEX code appears instantly with a preview. Copy it, or the RGB or HSL value.

Examples

RGB HEX
rgb(255, 255, 255) #FFFFFF
rgb(255, 94, 77) #FF5E4D
rgb(14, 11, 16) #0E0B10
rgba(91, 43, 130, 0.5) #5B2B8280

Why use HEX?

HEX codes are compact, easy to copy and supported everywhere — in CSS, design tools like Figma, brand guidelines and HTML attributes.

Frequently asked questions

How do I convert RGB to HEX manually?

Convert each channel from decimal to a two-digit hexadecimal number and join them. rgb(255, 94, 77) → FF, 5E, 4D → #FF5E4D.

What range do RGB values use?

Each channel is a whole number from 0 to 255. Alpha (opacity) ranges from 0 (transparent) to 1 (opaque).

How is alpha converted?

When alpha is below 1, an extra pair of digits is added: alpha × 255 in hex. rgba(255, 0, 0, 0.5) becomes #FF000080.

More Color tools →