RGB ↔ Hex Converter
Convert between RGB and HEX color codes

🔒 On-device · Method · · Disclaimer · RGB ↔ Hex Converter
Need to convert between RGB and HEX color codes? RGB ↔ Hex Converter answers in seconds. You supply Red (0-255), Green (0-255) and Blue (0-255) to RGB ↔ Hex; the answer follows at once. RGB ↔ Hex puts the headline number first. Students and professionals reach for RGB ↔ Hex when speed matters. Nothing is uploaded while RGB ↔ Hex works, and the figures stay put. Looking for rgb to hex or free online rgb ↔ hex converter? RGB ↔ Hex covers both. RGB ↔ Hex is designed for real people. Labels stay plain. RGB ↔ Hex stays bookmarked for next time.
One colour, two notations
RGB 79, 70, 229 converts to #4F46E5. Each channel becomes two hexadecimal digits: 79 = 4F, 70 = 46, 229 = E5, joined in red-green-blue order behind a hash.
The two forms carry exactly the same information. Hex is simply the same three bytes written in base 16 instead of base 10, which is why every hex colour has six digits and every RGB value has three numbers between 0 and 255.
Why two digits per channel
A channel is one byte: 0 to 255, or 00 to FF in hexadecimal. Two hex digits hold exactly that range, so 256 × 256 × 256 gives the familiar 16,777,216 colours.
The conversion is positional: the first digit is worth 16 and the second worth 1. 4F = 4 × 16 + 15 = 79. E5 = 14 × 16 + 5 = 229.
Worked example, all three channels
Red 79 → 79 ÷ 16 = 4 remainder 15 → 4F (F is 15).
Green 70 → 70 ÷ 16 = 4 remainder 6 → 46.
Blue 229 → 229 ÷ 16 = 14 remainder 5 → E5 (E is 14).
Result: #4F46E5, a mid indigo.
Going the other way is the same arithmetic reversed: take #FFFFFF, split into FF FF FF, evaluate each as 255 255 255 — pure white. #000000 is 0 0 0.
Short hex and alpha
Three-digit hex such as #0AF is shorthand: each digit is doubled, giving #00AAFF. Eight-digit hex adds an alpha pair at the end, so #4F46E5FF is the same colour fully opaque, and #4F46E500 is fully transparent. The converter reads the six-digit form.
Practical detail worth knowing
- sRGB is assumed. The same hex value on a wide-gamut display may render slightly differently; the notation names a space, it does not fix the appearance.
- Hex is case-insensitive. #4f46e5 and #4F46E5 are the same colour — the uppercase convention simply reads better in code.
- Values are clamped at 0–255. A negative or oversized channel is not a brighter colour, it is an invalid one.
- Design-token names are not interchangeable. Matching a hex code to a brand token across Figma and CSS is a common source of drift.
Frequently Asked Questions
Why is RGB 79, 70, 229 written as #4F46E5?
Each channel is converted to base 16 as two digits: 79 = 4F, 70 = 46, 229 = E5. Concatenated in red-green-blue order with a leading hash, that is #4F46E5.
What is F in hexadecimal?
F is 15 — the digits run 0–9 then A–F. That is why two hex digits cover 0–255: FF = 15 × 16 + 15 = 255.
What does a three-digit hex code mean?
Shorthand where each digit is doubled. #0AF means #00AAFF. It only exists for codes whose pairs repeat, which is why #4F46E5 cannot be shortened.
What do the last two digits of an eight-digit hex code do?
They set alpha, from 00 (transparent) to FF (opaque). #4F46E580 is the indigo at 50% alpha; the six-digit form is always fully opaque.
Does a hex code look the same on every screen?
Not exactly. Hex implies sRGB, and displays vary in gamut, calibration and brightness, so the same code can appear different on a phone and a calibrated monitor even though the numbers are identical.
Power Supply Calculator and other Tech & Digital tools
Power Supply Calculator · RAID Capacity Calculator · URL Encoder / Decoder · IP Subnet Calculator · Reading Time (Web) · TV Screen Size Calculator · Tech & Digital Guides