DevSwitch.net

Resetting tool...

Back to Tools
#FF

HEX to RGB Converter

Convert hexadecimal color codes to RGB values instantly

Color Tools

Enter 3 or 6 character hex code (with or without #)

Runs in your browser

Quick Colors:

Preview & Output

Click swatch to open native picker

Fine-tune Color

Adjust each channel independently

Turn a hex code into RGB values

Type a hex color code, with or without the #, and the HEX to RGB converter shows it as rgb(255, 136, 0) for CSS and as plain numbers, 255, 136, 0, for fields that want each channel on its own. Three-digit codes work too: F80 is the same color as FF8800.

Click the swatch to choose a color by eye, or drag a slider to change one channel; the hex code in the box follows. The R, G and B numbers on the swatch update with every change.

How a hex code becomes RGB

A 6-digit code is three pairs of base-16 digits: red, green and blue. For #FF5733:

PairChannelCalculationValue
FF Red 15 × 16 + 15 255
57 Green 5 × 16 + 7 87
33 Blue 3 × 16 + 3 51

So #FF5733 is rgb(255, 87, 51). The letters A to F stand for 10 to 15, which is why FF, the largest pair, is 255. Every code maps to exactly one set of numbers, so nothing is rounded in this direction.

In JavaScript, parseInt('57', 16) returns 87. For longer hex numbers than a color pair, the hex to decimal converter shows each digit's place value.

Short codes, alpha and invalid input

What the box does with each kind of code:

  • Input

    #F80 · f80

    Result

    Each digit is doubled, so this is #FF8800: rgb(255, 136, 0). Upper and lower case give the same result.

  • Input

    #FF880080

    Result

    Codes with an alpha pair don't fit: the box holds a # and six digits, so the last pair is cut off and the opacity is lost. Read it yourself: 80 is 128 of 255, about 50%.

  • Input

    #F808 · #GG0000

    Result

    Four digits, or a letter after F, show Invalid HEX and the swatch turns gray until the code is valid again.

Where the RGB numbers go

  • CSS with opacity

    Add a fourth value to fade a color: rgba(255, 136, 0, 0.5) is the same orange at 50%. Gradients that fade to transparent are built the same way, as how to build color gradients in CSS shows.

  • Canvas, shaders and native apps

    Many APIs take each channel as a 0 to 1 fraction. Divide by 255: 136 becomes 0.533, so #FF8800 is 1, 0.533 and 0.

  • Separate R, G and B fields

    Design tools and image editors with one field per channel take the RGB Values row as it is: 255, 136, 0.

To see lighter tints and matching colors for the same code, open it in the color explorer.

Starting from RGB numbers?

Type 255, 136, 0 or rgb(255, 136, 0) and get the 6-digit code #FF8800.

HEX to RGB questions

No. FF8800 and #FF8800 give the same result, in upper or lower case.

The code is not 3 or 6 hex digits: a digit is missing, there are 4 or 8 of them, or it has a letter after F. Only 0 to 9 and A to F are hex digits.

Divide each channel by 255. For #FF8800 that is 1, 0.533 and 0. The converter shows 0 to 255 only.

Both describe the same color, but rgb() is easier to change in code: you can raise one channel, or add an alpha value with rgba(), without converting digits.

No. It runs in your browser as you type.