Hex to RGB Color Converter
Convert a hex color code to RGB values instantly. Free, no signup.
How to use this tool
- Enter hex color in the fields above.
- Results update instantly as you type — or click Calculate.
- Read your rgb value and the full breakdown beneath it.
Convert CSS hex color codes like #3a86ff to their RGB equivalents for use in CSS, design tools, or code.
How it works
Hex to RGB Color Converter takes a CSS hexadecimal color code and outputs the equivalent red, green, and blue component values on the 0-255 scale. Hex colors are the standard format in HTML and CSS (for example #3a7bd5), while RGB values are needed in JavaScript canvas operations, image processing, design tools, and some CSS functions like rgba().
Enter a 3- or 6-digit hex code (with or without the leading #) and the tool splits it into its red, green, and blue channels, converts each pair of hex digits to decimal, and displays the three numeric components. Short 3-digit codes (like #f0a) are automatically expanded to 6 digits before conversion.
Use this tool when you have a hex color from a design file or style sheet and need its RGB breakdown for use in code, color analysis, or passing to an API that expects numeric color components.
Worked example
Convert a brand color from a style guide
- Find the brand hex color in the style guide: #1a73e8
- Enter #1a73e8 into the Hex color field.
- Click Convert.
- Read the output: R: 26, G: 115, B: 232
RGB(26, 115, 232) -- ready to use in rgba() CSS or a canvas fillStyle.
Common mistakes to avoid
- Entering an invalid hex code with non-hex characters (like G or Z): hex digits are only 0-9 and A-F; any other character will produce an error.
- Confusing 3-digit and 6-digit notation: #fff is pure white (expanded to #ffffff) but #ffff is not valid -- hex colors are either 3 or 6 digits, not 4 or 5.
- Expecting the tool to return float values (0.0-1.0): this tool returns standard 0-255 integers; for contexts that use 0-1 floats, divide each component by 255.
Key terms
- Hexadecimal color
- A color represented as a # followed by six (or three) hex digits, where each pair encodes the intensity of red, green, and blue on a 0-255 scale.
- RGB
- A color model where colors are described by the intensity of their Red, Green, and Blue components, each ranging from 0 (none) to 255 (full intensity).
- Short hex notation
- A 3-digit hex color like #abc where each digit is doubled to get the full color: #abc expands to #aabbcc.
Frequently asked questions
- What is a hex color?
- A hex color is a 6-digit hexadecimal representation of an RGB color, prefixed with #. Each pair of digits represents red, green, and blue (0-255).