Skip to main content
HSCalculadora

Hex to RGB Converter

Convert a hex color code into RGB values.

A 3- or 6-digit hex code, with or without the leading #.

Results update as you type.

RGB value
—
Red—
Green—
Blue—

How it works

A hex to RGB converter translates a hexadecimal color code, the six-character strings like #0EA5E9 used throughout web and graphic design, into the red, green, and blue values that describe the same color numerically. Both formats represent identical colors; hex is compact and common in CSS and design tools, while RGB is easier to read, adjust, and use in contexts like image editing or programmatic color math. This conversion is useful whenever you move between tools that prefer different notations. A brand guide might specify hex codes, but a spreadsheet, a native app, or an animation library might want separate R, G, and B numbers. Seeing the channel values also helps you understand and tweak a color: raising the red value warms it, while equal channels produce a grey. The tool accepts both full six-digit codes and three-digit shorthand. The conversion works because each pair of hex digits encodes one channel as a number from 0 to 255, the range a single byte can hold. Reading each pair in base sixteen recovers that value directly, and the three together define the color. Web developers, designers, and anyone matching colors across applications use a hex to RGB converter to keep colors consistent when they cross between design systems, code, and content.

Formula

each channel = the two hex digits read as a base-16 number (0–255)

A hex color packs three colour channels into six hexadecimal digits, two per channel. Each pair is a base-16 number, so the digits are read as sixteens and units: the left digit is multiplied by sixteen and added to the right digit, giving a value from 0 to 255. Shorthand three-digit codes double each digit first. The conversion works because hexadecimal is simply a compact way of writing the same 0-to-255 byte each channel uses.

Source:Standard digital media (sRGB)

We review all our tools from time to time to ensure accuracy.

Worked example

Hex color code:#0EA5E9
0E = 14, A5 = 165, E9 = 233, giving rgb(14, 165, 233).

How to use this calculator

  1. 1

    Enter your values

    Enter hex color code.

  2. 2

    Adjust the options

    Fine-tune any options to match your situation.

  3. 3

    Read your result

    RGB value updates instantly as you type — no button to press.

Frequently asked questions

What is the difference between hex and RGB?

Hex and RGB describe the exact same colors in different notations. RGB lists three numbers from 0 to 255 for red, green, and blue. Hex encodes those same three values as pairs of base-16 digits in a single string prefixed with a hash. Hex is compact and dominant in web CSS, while RGB is easier to read and adjust arithmetically. Converting between them never changes the colour itself.

Can I enter a 3-digit hex code?

Yes. Three-digit shorthand hex codes expand each digit by doubling it, so #0af becomes #00aaff. This shorthand only works when both digits of each channel are identical, which is why it can express fewer colours than the full six-digit form. The converter automatically detects and expands three-digit codes, then reads each resulting pair as a channel value, so either format returns the correct RGB result.

Do I need to include the hash symbol?

No. The converter accepts codes with or without the leading hash, so #0EA5E9 and 0EA5E9 both work. The hash is a convention that marks a value as a hex color in CSS and design tools, but it carries no colour information itself. Whichever way you paste the code, the converter strips any hash and reads the remaining digits as the three colour channels.

What do the red, green, and blue numbers mean?

Each of the three numbers ranges from 0 to 255 and states the intensity of that primary colour channel. Zero means the channel is off and 255 means it is at full strength. Screens mix these three lights additively, so all three at 255 make white, all at 0 make black, and equal middling values make grey. Adjusting one channel shifts the colour toward or away from that primary.

Why is the range 0 to 255 for each channel?

Each channel is stored in one byte, which holds eight bits and therefore 256 distinct values from 0 to 255. Two hexadecimal digits express exactly that range, since sixteen times sixteen is 256. This eight-bit-per-channel scheme gives about 16.7 million possible colours across the three channels, enough that the eye perceives smooth gradients. It is the standard depth for web and most everyday digital colour.