Hex to RGB Color Converter

Convert between #RRGGBB hex codes and rgb(R, G, B) values. Updates live as you type.

Color conversion tool

Enter six hex digits, or three for shorthand (e.g. F80FF8800).

RGB values (0–255)

How hex color codes work

A CSS hex color starts with # followed by the red, green, and blue channels encoded in hexadecimal. The usual form is #RRGGBB: two digits for red, two for green, and two for blue. Each pair ranges from 00 (none of that channel) to FF (full intensity), because two hex digits represent 8 bits (256 steps). In JavaScript, parseInt("FF", 16) yields 255.

RGB color model

RGB is an additive color model: red, green, and blue light are combined. Each channel is typically stored as an integer from 0 to 255 (one byte). Equal R, G, and B give a neutral gray; rgb(0,0,0) is black and rgb(255,255,255) is white. This matches what hex encodes, just written in decimal instead of base-16 pairs.

Shorthand hex

When each channel repeats the same nybble, CSS allows three-digit hex: #RGB expands to #RRGGBB. For example, #FFF is the same as #FFFFFF, and #39C equals #3399CC. This converter accepts both forms in the hex field.

Hex vs RGB usage

In CSS, you will see both #1e40af and rgb(30, 64, 175); they describe the same sRGB color. Design tools (Figma, Sketch, browsers’ devtools) often let you edit either representation and copy one format for the other. Hex is compact and easy to scan; RGB can be simpler when you are tweaking one channel with the keyboard.

Frequently asked questions

What is the difference between hex and RGB?
Hex encodes the same 24-bit sRGB color as three pairs of hexadecimal digits (#RRGGBB). RGB writes the same channels as decimal numbers from 0 to 255. Both are common in CSS and design tools; hex is compact, while RGB can be easier to adjust numerically.
Does three-digit hex like #ABC mean the same as six-digit?
Yes. Shorthand hex repeats each digit: #ABC expands to #AABBCC. This converter accepts both 3- and 6-digit forms after the #.
Are my colors sent to a server?
No. All conversion and preview updates run locally in your browser. Nothing you type is uploaded or stored by this page.