We use essential cookies to make this site work. Optional analytics cookies help us improve your experience. Privacy Policy
Hex to RGB Converter
Convert hex color codes to RGB, RGBA, and HSL instantly. Supports 3, 6, and 8-digit hex with alpha. Free, private, 100% browser-based. Free online utility.
How to use
Paste a hex code — Type or paste any hex color (e.g. #3B82F6, #FFF, or with alpha #3B82F6CC)
Read converted values — RGB, RGBA, and HSL update instantly with a live color preview
Copy what you need — Tap any value to copy it for your CSS, design tool, or codebase
What Is Hex to RGB Conversion?
Hex to RGB conversion translates a hexadecimal color string like #3B82F6 into its three decimal components — red, green, and blue — each in the 0–255 range. The reverse is just as easy. Designers, developers, and digital marketers use this conversion every day when copying colors between Figma, Sketch, CSS, design systems, mobile-app SDKs, and image-editing software.
How Hex Codes Encode RGB
A six-digit hex code splits into three two-digit pairs. Each pair is a base-16 number from 00 (zero) to FF (255) representing the intensity of red, green, or blue. So #3B82F6 decodes as R=59, G=130, B=246 — a medium-bright blue. The full 24-bit hex system supports 16,777,216 distinct colors.
Shorthand and Alpha Channel
3-digit shorthand:#F0A is the same as #FF00AA — each digit is duplicated.
8-digit (with alpha):#3B82F6CC means the same blue with ~80% opacity (CC ÷ FF ≈ 0.8). The tool converts this to rgba(59, 130, 246, 0.8).
Case-insensitive:#3b82f6 and #3B82F6 are equivalent.
When to Use Each Format
CSS, HTML: hex is concise and universally supported in stylesheets and inline attributes.
RGB / RGBA: needed when you want to animate opacity, mix colors at runtime, or use modern color-mix functions.
HSL: easier to adjust lightness or saturation without changing the underlying hue — useful for building accessible color systems.
Common Use Cases
Match a brand color from a hex spec into a design tool that only accepts RGB.
Generate rgba() values for overlays, glassmorphism, or fading backgrounds.
Debug color mismatches between Figma, Sketch, Tailwind, and Material Design.
Build accessible color palettes by working in HSL.
Privacy
This tool runs entirely client-side. The color you paste never leaves your browser — no uploads, no tracking pixels on conversion, no log files. Convert dozens or thousands of colors safely.
A hex color is a six-digit (or eight with alpha) base-16 representation of an RGB color. The first two digits encode red, the middle two encode green, and the last two encode blue — each ranging 00–FF (0–255). #FFFFFF is white; #000000 is black.
Does it support shorthand like #FFF?
Yes. Three-digit shorthand is automatically expanded — #F0A becomes #FF00AA. Four-digit shorthand with alpha (#F0AC) is also supported.
What about 8-digit hex with alpha?
Eight-digit codes carry an alpha channel in the last two digits. The tool parses these and outputs a proper rgba() value with the alpha converted from 00-FF to 0.0-1.0.
Are the colors processed online?
No. Every conversion runs entirely inside your browser using simple math. Nothing is uploaded or logged.
Related free tools
Text Shadow Generator — Design CSS text shadows with a visual editor and live preview.