Tools.GamesLoop Logo
TOOLS.GAMESLOOP160+ Free Online Tools

Convert RGB to HEX

Convert RGB values to a hex colour code.

RGB to HEX Converter

Developer tool running locally in browser

Advertisement
Ad Space (auto) — Configurable via NEXT_PUBLIC_ADSENSE_CLIENT

What does RGB to HEX Converter do?

Convert red, green and blue values into a hexadecimal colour code, with sliders as well as numeric entry. Alpha is supported and produces the 8-digit hex form.

How to Use RGB to HEX Converter

  1. 1
    Set the RGB valuesDrag the sliders or type numbers 0–255.
  2. 2
    Read the hex codeIt updates as you adjust.
  3. 3
    Copy the codeWith or without the leading hash.

Key Features

  • Sliders and numeric fields for each channel
  • Alpha channel producing 8-digit hex
  • Live colour swatch
  • Shorthand 3-digit form offered when the value allows it
  • Accepts a pasted rgb() or rgba() string

Frequently Asked Questions

How do I convert RGB to hex by hand?

Convert each channel to a two-digit hexadecimal number and concatenate. 79 is 4F, 70 is 46, 229 is E5, giving #4F46E5.

Why are RGB values limited to 255?

Because each channel is stored in one byte, giving 256 levels from 0 to 255. Three channels of 256 levels produce 16,777,216 possible colours.

Can every RGB colour be written as 3-digit hex?

No. Shorthand only works when both digits of each pair are the same, so #FF8800 shortens to #F80 but #FE8800 cannot shorten at all.

How is alpha represented in hex?

As a fourth pair of digits, from 00 (transparent) to FF (opaque). An alpha of 0.5 is 128, which is 80 in hex.