Hex to RGB Converter
Turn a hex code into RGB, RGBA, and HSL with a live swatch and one-click copy for every format.
3, 6, or 8 digit hex, with or without the #. Converted live as you type, all in your browser.
Formats
How to convert a HEX color to RGB
Enter a hex color
Type or paste a hex code with or without the leading #, or open the color picker to choose one visually.
Read the values
The separate red, green, and blue channels, a preview swatch, and ready-to-paste rgb(), rgba(), hsl(), and CSS strings all update live.
Copy a format
Use the copy button on any row to grab a single format, or Copy all to take every one at once.
Why use this tool
Every format from one hex
A single hex code produces its RGB, RGBA, and HSL forms plus a paste-ready CSS string, all at the same time.
Separate channel values
Red, green, blue, and alpha are shown as individual 0 to 255 numbers, which is the exact conversion most people come here for.
Type it or pick it
Enter a hex code by hand or choose a color visually with the picker; the two stay in sync as you go.
Alpha channel aware
An 8-digit hex carries its transparency into the rgba() and hsla() output and into the swatch, which sits on a checkerboard so it shows.
Runs entirely in your browser
Everything happens on your device; nothing is uploaded.
About this tool
This converter turns a HEX color code into its RGB, RGBA, and HSL equivalents. Type a hex value with or without the leading #, in short form like #f43, standard 6-digit form, or 8-digit form that includes an alpha channel, or use the color picker to choose one visually. The individual red, green, and blue channels, a live swatch, and ready-to-paste rgb(), rgba(), hsl(), and CSS custom property strings all update on every keystroke.
Reading a hex code as separate 0 to 255 channel values is the everyday job here. You might need the RGB numbers to feed a canvas fill, an rgba() string to add transparency to a brand color, or an hsl() form to nudge lightness in a stylesheet. Shorthand hex expands automatically, an alpha byte in an 8-digit code carries through to every output, and an unrecognised value shows a short message instead of a wrong answer.
Everything runs on your device, so the colors you enter are never uploaded. Conversion is only one part of working with color: the color converter reads RGB, HSL, and HSV in either direction, the contrast checker tests a foreground and background pairing against WCAG rules, and the gradient generator builds a CSS background from your color.
Frequently asked questions
- What hex formats can I enter?
- You can enter 3, 4, 6, or 8 hex digits, with or without the leading #. Shorthand like #f43 expands to #ff4433, and an 8-digit code such as #ff443380 adds an alpha channel.
- Does it keep transparency?
- Yes. If your hex includes an alpha channel, it is preserved: the RGBA and HSL outputs use their alpha forms and the swatch renders over a checkerboard so the transparency is visible. Fully opaque colors use the shorter notation.
- What do the RGB numbers mean?
- RGB describes a color as three channels, red, green, and blue, each from 0 to 255. A hex code is just those same channels written in base 16, so #6366f1 is red 99, green 102, blue 241.
- Why does the color picker drop my alpha?
- The built-in color picker only understands 6-digit hex, so choosing a color sets the red, green, and blue channels and makes it fully opaque. To keep an alpha channel, type the 8-digit hex into the field instead.
- Is my data uploaded anywhere?
- No. Everything runs in your browser; nothing is sent to a server.
Related tools
Color Converter
Type or pick a color and get HEX, RGB, HSL, HSV, and CMYK side by side, with a live swatch preview.
Contrast Checker
Check the WCAG contrast ratio between two colors and see which AA and AAA levels pass.
CSS Gradient Generator
Design linear, radial, and conic CSS gradients with custom color stops, per-stop transparency, and copy the code.
Analogous Color Generator
Turn any base color into a three swatch analogous palette by rotating its hue.
Aspect Ratio Calculator
Solve the missing width or height for any aspect ratio, from 16:9 to a custom shape.
CSS Box Shadow Generator
Dial in a CSS box-shadow with live preview and copy the exact code.