Skip to main content

Hex to RGB

Convert a hex colour (3, 4, 6 or 8 digits) to RGB or RGBA with the alpha as 0–1 and a percentage, and see a preview. Copy the CSS. Free and private.

Need other colour formats? Use the Colour Converter.

64 common colours

NameHexRGB
Black#000000rgb(0, 0, 0)
White#ffffffrgb(255, 255, 255)
Red#ff0000rgb(255, 0, 0)
Lime#00ff00rgb(0, 255, 0)
Blue#0000ffrgb(0, 0, 255)
Yellow#ffff00rgb(255, 255, 0)
Cyan#00ffffrgb(0, 255, 255)
Magenta#ff00ffrgb(255, 0, 255)
Silver#c0c0c0rgb(192, 192, 192)
Gray#808080rgb(128, 128, 128)
Maroon#800000rgb(128, 0, 0)
Olive#808000rgb(128, 128, 0)
Green#008000rgb(0, 128, 0)
Purple#800080rgb(128, 0, 128)
Teal#008080rgb(0, 128, 128)
Navy#000080rgb(0, 0, 128)
Orange#ffa500rgb(255, 165, 0)
Pink#ffc0cbrgb(255, 192, 203)
Brown#a52a2argb(165, 42, 42)
Gold#ffd700rgb(255, 215, 0)
Coral#ff7f50rgb(255, 127, 80)
Salmon#fa8072rgb(250, 128, 114)
Tomato#ff6347rgb(255, 99, 71)
Crimson#dc143crgb(220, 20, 60)
Indigo#4b0082rgb(75, 0, 130)
Violet#ee82eergb(238, 130, 238)
Orchid#da70d6rgb(218, 112, 214)
Plum#dda0ddrgb(221, 160, 221)
Turquoise#40e0d0rgb(64, 224, 208)
Aquamarine#7fffd4rgb(127, 255, 212)
Sky blue#87ceebrgb(135, 206, 235)
Steel blue#4682b4rgb(70, 130, 180)
Royal blue#4169e1rgb(65, 105, 225)
Dodger blue#1e90ffrgb(30, 144, 255)
Forest green#228b22rgb(34, 139, 34)
Sea green#2e8b57rgb(46, 139, 87)
Spring green#00ff7frgb(0, 255, 127)
Chartreuse#7fff00rgb(127, 255, 0)
Khaki#f0e68crgb(240, 230, 140)
Beige#f5f5dcrgb(245, 245, 220)
Ivory#fffff0rgb(255, 255, 240)
Lavender#e6e6fargb(230, 230, 250)
Chocolate#d2691ergb(210, 105, 30)
Sienna#a0522drgb(160, 82, 45)
Tan#d2b48crgb(210, 180, 140)
Slate gray#708090rgb(112, 128, 144)
Dark gray#a9a9a9rgb(169, 169, 169)
Light gray#d3d3d3rgb(211, 211, 211)
Indigo (brand)#6366f1rgb(99, 102, 241)
Sky (brand)#38bdf8rgb(56, 189, 248)
Emerald#10b981rgb(16, 185, 129)
Amber#f59e0brgb(245, 158, 11)
Rose#f43f5ergb(244, 63, 94)
Slate 900#0f172argb(15, 23, 42)
Slate 500#64748brgb(100, 116, 139)
Slate 100#f1f5f9rgb(241, 245, 249)
Teal 500#14b8a6rgb(20, 184, 166)
Violet 500#8b5cf6rgb(139, 92, 246)
Pink 500#ec4899rgb(236, 72, 153)
Red 500#ef4444rgb(239, 68, 68)
Orange 500#f97316rgb(249, 115, 22)
Lime 500#84cc16rgb(132, 204, 22)
Cyan 500#06b6d4rgb(6, 182, 212)
Blue 500#3b82f6rgb(59, 130, 246)

Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)

Next steps

Done here? Use the Send to… menu on the result to carry it on to RGB to Hex.

Free Hex to RGB

Type a hex colour such as #6366f1 and get the red, green and blue values for CSS. Colours with transparency are supported. It gives developers a quick browser-based way to solve a focused hex to rgb task before moving the result into a project.

How to use Hex to RGB

Short colours (#f00) and colours with an alpha part (#6366f180) work too. Copy the CSS line you need.

Common mistakes

  • Using 5 or 7 digits: a hex colour has 3, 4, 6 or 8.
  • Forgetting the alpha part is the last pair, not the first.

Frequently asked questions

How is hex turned into RGB?
The six digits are three pairs: red, green and blue. Each pair is a hex number from 0 to 255. #6366f1 is 63 → 99, 66 → 102 and f1 → 241.
What are 3, 4 and 8 digit colours?
Three digits repeat each digit (#f00 is #ff0000). Four and eight digits add an alpha (transparency) part at the end.
What is alpha?
How opaque the colour is, from 0 (clear) to 1 (solid). In hex it is a number from 00 to FF.
Is anything uploaded?
No. The conversion runs in your browser.
How do I use this hex to rgb tool?
Use the interactive controls above; processing stays in your browser and the result is intended as a practical starting point for development work.

More Code & Conversion

View all Code & Conversion tools →