Skip to content
snip tools

RGB to HEX converter

Convert RGB / RGBA to HEX with a live swatch.

Runs 100% in your browser
HEX
HEX short
HEX with alpha
HSL

How to convert RGB to HEX

  1. Paste an RGB value. Use the rgb()/rgba() input, or move the channel sliders.
  2. Copy the HEX. Both short (#RGB when possible) and long (#RRGGBB) forms are shown.

RGB and HEX in practice

Designers, devs and tools each prefer different color notations. Style guides often standardise on HEX for branding (it's compact) while CSS authoring sometimes prefers RGB or HSL for runtime manipulation. When you need alpha, RGBA is more readable than the 8-digit hex; when you need to paste into Photoshop or Figma, the 6-digit hex is what those tools want.

Frequently asked questions

How are RGB and HEX related?
They encode the same 24-bit color. RGB lists three decimal channels (0–255); HEX writes them as a 6-digit hexadecimal preceded by #. rgb(37, 99, 235) = #2563EB.
What about alpha (transparency)?
rgba(r, g, b, a) carries the alpha 0–1; the 8-digit hex #RRGGBBAA encodes the same alpha as 00–FF. This tool supports both — pass rgba(..., 0.5) to get the AA hex byte.
Does the page send my colors anywhere?
No. All conversion is pure math in your browser.