HEX to RGB Converter

Convert any HEX color code to its RGB values instantly. Enter a 3- or 6-digit hex code (with or without the # sign) and get the red, green, and blue channel values ready to paste into CSS, code, or a design tool. The tool also outputs RGBA, HSL, and HSLA so you have every format in one place.

All processing happens in your browser. No data is sent to any server.

Frequently Asked Questions

What is a HEX color code?
A HEX color code is a 6-digit (or 3-digit shorthand) hexadecimal number that represents a color. Each pair of digits corresponds to the red, green, and blue channel values from 00 (0) to FF (255). For example, #FF0000 is pure red.
How do I convert HEX to RGB manually?
Split the hex code into three pairs: RR, GG, BB. Convert each pair from base-16 to base-10. For example, #4A90E2 splits into 4A (74), 90 (144), E2 (226), giving rgb(74, 144, 226).
Does it work with 3-digit hex codes?
Yes. 3-digit hex codes like #F0A are automatically expanded to their 6-digit equivalents (#FF00AA) before conversion.
When would I use RGB instead of HEX in CSS?
RGB is useful when you need to control opacity dynamically using rgba(), or when you're manipulating color values programmatically in JavaScript. HEX is more compact and more common in static stylesheets.

Related Tools