COLOR TOOLS
RGB to Hex — Convert Colour Codes Both Ways
Convert RGB to hex and hex to RGB free. Enter red, green, blue values or a #hex code and get the other format instantly. Runs in your browser.
Seus arquivos nunca saem do seu dispositivo.
- HEX
- #1a2b3c
- RGB
- rgb(26, 43, 60)
RGB and hex are two ways of writing the same colour. RGB lists three numbers from 0 to 255 for red, green, and blue; hex packs those same values into a six-digit code behind a hash. Design tools and CSS often favour hex for its compactness, while image editors and colour pickers lean on RGB — so being able to flip between them saves you the base-16 arithmetic.
The conversion is pure maths that runs in your browser. Nothing is uploaded, and there's no image involved — you type a value and the matching format appears instantly.
How the conversion works
Each RGB channel (0–255) becomes a two-digit base-16 number, and the three pairs are joined behind a hash. Converting back splits the six digits into three pairs and reads each as a 0–255 value.
Another: rgb(255, 99, 71) → FF, 63, 47 → #FF6347 (tomato). The letters A–F appear because hex is base 16 — after 9 it uses A through F for 10 to 15, which is how two digits cover all 256 values (00 to FF) a single channel needs.
RGB
rgb(255, 0, 0) → FF, 00, 00Hex
#FF0000 (pure red)Frequently asked questions
- Does it support shorthand three-digit hex?
- Three-digit hex like #F63 is shorthand where each digit is doubled (#FF6633). This tool works with the standard six-digit form; expand a shorthand code to six digits before entering it.
- What about alpha or transparency?
- This converts opaque RGB and six-digit hex colours. Alpha (the transparency channel in rgba or eight-digit hex) is a separate value and isn't part of the RGB-to-hex mapping here.
- Is anything sent to a server?
- No. The conversion is simple maths done in your browser, so nothing you enter leaves your device.