HEX to RGB Color Converter
Convert a HEX color code to RGB (or RGB back to HEX) with a live preview swatch and copy-ready CSS values.
โ 100% Freeโ No Signupโ No Watermarkโ Unlimited Use
Convert Between HEX and RGB Color Codes
Designers and developers constantly switch between two ways of writing colors: HEX (like #6366f1, used in CSS and design tools) and RGB (like rgb(99, 102, 241), used for opacity, gradients and canvas). This free HEX to RGB converter translates either direction instantly, with a live swatch so you can see the color as you go.
Type a hex code, drag the color picker, or enter R/G/B values, all three stay in sync, and both formats are one click to copy into your stylesheet.
How to Use the HEX to RGB Converter
- 1Enter a hex code (3 or 6 digits, with or without #), or use the color picker.
- 2Or type R, G and B values (0-255) to convert the other way.
- 3The swatch and both color formats update live.
- 4Click Copy next to HEX or RGB to grab the CSS-ready value.
Why Use MakeToolz's HEX to RGB Converter?
Both directions
HEX โ RGB and RGB โ HEX, always kept in sync.
Live swatch
See the actual color as you type, no guessing from numbers.
Shorthand hex
Accepts 3-digit hex (#63f) and expands it correctly.
Color picker
Drag a visual picker to find a color, then copy its exact codes.
CSS-ready
Copy #hex or rgb(โฆ) formatted exactly as you'd paste into a stylesheet.
Free & private
Runs in your browser, no signup.
What the Numbers Behind a Hex Color Mean
A hex color code is three pairs of characters, one pair each for red, green, and blue. Each pair is a base-16 number from 00 to FF, which equals 0 to 255 in plain decimal. So #6366F1 means 99 red, 102 green, and 241 blue. RGB writes those same three numbers directly as rgb(99, 102, 241). Both describe the identical color; they just spell it differently.
Understanding this makes the conversion feel less like magic. Split the hex into three pairs, read each pair as a value from 0 to 255, and you have RGB. Reverse the steps to go back.
Who Converts Hex to RGB and Why
Front-end developers reach for RGB when they need transparency. Hex describes a solid color, but the rgba() form adds an alpha channel for opacity, which hex alone cannot do in older stylesheets. Designers convert when a tool exports hex but their canvas or animation library expects RGB. Accessibility reviewers pull RGB values to run contrast checks, since the math for readability works on red, green, and blue numbers.
The need shows up any time a color has to move between a design file, a stylesheet, and code that manipulates pixels.
Hex and RGB Side by Side
| Color | Hex | RGB | Common use |
|---|---|---|---|
| White | #FFFFFF | rgb(255, 255, 255) | Backgrounds |
| Black | #000000 | rgb(0, 0, 0) | Text |
| Red | #FF0000 | rgb(255, 0, 0) | Alerts |
| Green | #00FF00 | rgb(0, 255, 0) | Success states |
| Indigo | #6366F1 | rgb(99, 102, 241) | Buttons, links |
| Mid grey | #808080 | rgb(128, 128, 128) | Borders |
How Opacity Fits In
Hex handles opacity with an optional fourth pair, so #6366F1CC adds an alpha value. Not every tool reads eight-digit hex, though, which is why the rgba() form stays popular. Take the three RGB numbers from this converter and wrap them as rgba(99, 102, 241, 0.8) where the last number runs from 0 for fully clear to 1 for fully solid. That gives you a see-through version of any color for overlays, shadows, and hover states.
Why This Matters for Contrast and Design
Readable text needs enough contrast between the letters and the background. Contrast ratios are calculated from RGB values, so converting to RGB is often the first step in checking whether a color pair passes accessibility guidelines. Working in RGB also makes it easy to nudge a single channel, brightening a shade by raising all three numbers or warming it by lifting red. When you want to combine two shades into a palette, a color mixer takes over from there.
Common Mistakes and Tips
The most common mistake is dropping the hash or mixing up digit order. A hex code needs six characters (or three in shorthand), and each pair maps to a fixed channel: first red, then green, then blue. Swapping pairs gives a different color.
Another slip is treating three-digit shorthand as if the digits stand alone. In #63F each digit doubles, so it expands to #6633FF, not #063F00. This tool expands shorthand for you.
A handy tip: keep a small palette of your brand colors in both formats so you never re-convert the same value. And when you need to store or transmit color data as text, a Base64 encoder and decoder handles that separately from color math.
People Also Ask
How do I turn a hex code into RGB by hand?
Split the six characters into three pairs, then convert each pair from base 16 to a number from 0 to 255. For #FF8800 that gives 255, 136, 0, so the RGB is rgb(255, 136, 0).
Is hex or RGB better for CSS?
Neither is better for solid colors; they render the same. Hex is shorter to type, while RGB and rgba() are easier when you need opacity or want to adjust one channel in code.
What does FF mean in a hex color?
FF is the base-16 way of writing 255, the highest value for a channel. So a pair of FF means that color channel is at full strength.
Can every RGB color be written as hex?
Yes. Every red, green, and blue value from 0 to 255 has a two-character hex form, so any standard RGB color converts to a six-digit hex code and back with no loss.
Why does my hex code look wrong after converting?
Usually the digits were entered in the wrong order or a character was mistyped. Check that the first pair is red, the second green, and the third blue, and that every character is 0 to 9 or A to F.
How do I add transparency to a hex color?
Convert to RGB, then use the rgba() form and add a fourth number for alpha between 0 and 1. For example rgb(99, 102, 241) becomes rgba(99, 102, 241, 0.5) for half transparency.
What is the RGB of pure white and black?
White is rgb(255, 255, 255), all channels at full. Black is rgb(0, 0, 0), all channels off. Their hex codes are #FFFFFF and #000000.
Frequently Asked Questions
How do I convert a hex color to RGB?
What does the 3-digit hex shorthand mean?
Which format should I use in CSS?
Does it support alpha/opacity?
Related Free Tools
More Encoders & Converters
Base64 Encoder / DecoderURL Encoder / DecoderHTML Encoder / DecoderText to Markdown ConverterNumber Base ConverterRoman Numeral ConverterMilitary Time ConverterWords to Numbers