Copied!
Color Tool

Hex to RGB Color Converter

Convert any hex color code to RGB, RGBA, and HSL instantly with a live preview. This free online hex to RGB converter supports 3-digit shorthand (#F53), standard 6-digit (#FF5733), and 8-digit hex codes with alpha transparency (#FF573380). Use the color picker or RGB sliders to find the perfect color for your CSS, Tailwind, or design system. All conversions happen client-side in your browser.

hex-to-rgb.tool
RGB
rgb(0, 208, 132)
RGBA
rgba(0, 208, 132, 1)
HSL
hsl(158, 100%, 41%)
Hex (Normalized)
#00d084
R 0
G 208
B 132
A 100%

Frequently Asked Questions

How do you convert a hex color code to RGB manually?
A 6-digit hex color like #FF5733 is split into three pairs: FF (red), 57 (green), 33 (blue). Convert each pair from hexadecimal to decimal: FF = 255, 57 = 87, 33 = 51. So #FF5733 equals rgb(255, 87, 51). For 3-digit shorthand like #F53, double each digit first: F→FF, 5→55, 3→33, giving #FF5533.
What is the difference between hex, RGB, and HSL?
Hex is a compact hexadecimal notation (#RRGGBB). RGB defines colors as red, green, blue values from 0–255. HSL uses hue (0–360°), saturation (0–100%), and lightness (0–100%). All three can represent the same colors — they're different notation systems. HSL is often more intuitive for designers because you can independently adjust brightness and saturation without affecting hue.
Can hex codes include alpha transparency?
Yes. 8-digit hex codes (#RRGGBBAA) include an alpha channel. For example, #FF573380 has ~50% opacity (80 in hex = 128 in decimal ≈ 50.2%). CSS also supports 4-digit shorthand (#RGBA). All modern browsers (Chrome 62+, Firefox 49+, Safari 10+) fully support 8-digit hex colors in CSS.
What is the difference between 3-digit and 6-digit hex codes?
3-digit hex is shorthand where each digit is repeated: #F53 expands to #FF5533. This shorthand can represent 4,096 colors (16³), while 6-digit hex covers the full 16.7 million color range (16⁶). Use 3-digit shorthand only when each RGB pair has matching digits — it keeps CSS more concise.
Why do designers need to convert between hex and RGB?
Different tools and platforms use different color formats. Figma and design tools often show hex values, while CSS supports hex, RGB, and HSL. Some CSS properties (like gradients and opacity adjustments) work better with rgba(). Developers implementing designs need to convert between formats to match design specs exactly. Tailwind CSS configuration also uses hex codes that may need RGB equivalents for custom utility classes.
How do I convert hex to RGB in JavaScript?
Use parseInt with base 16: const r = parseInt(hex.slice(1,3), 16); const g = parseInt(hex.slice(3,5), 16); const b = parseInt(hex.slice(5,7), 16);. For 3-digit hex, expand each character first. A complete implementation should also handle the 8-digit #RRGGBBAA format by parsing the last two characters as the alpha channel (0–255, divided by 255 for a 0–1 range).