Translate and Convert RGB Color Values into Hexadecimal Hex Equivalent

In a html web page, there is code such as <body bgcolor=#ffffff> or color=”#000000″. The “ffffff” is the colour RGB hexadecimal value which will translate into a white, and “000000″ is black.

The RGB colour code must be converted into hexadecimal (Base-16) number in order for the browsers to understand them. Then the resulting two-digit hexadecimal (”hex” for short) numbers are strung together into a single six-digit code. So in the example above, the first two “f”s and “0″s stand for the red value, the next two stand for green, and the last two for blue.

It’s possible to get the RGB hex value from a colour chart. But if you encounter a favorite colour, it’s possible to get its RGB value and convert it into hex code.

To get the RGB value of a colour from a photo, simply open the photo or picture in Microsoft Paint or any image processing software. Use the pick color tools to pick the colour and the RGB value should be shown. For Microsoft Paint, after you pick the colour, click on Colors menu, and then Edit Colors. On the window shown, click on Define Custom Colors, and you will see the RGB value of the color you just selected shown there.

For translation/conversion to Hex calculation, we will use the color of lovely sea green with the RGB values R=51, G=219, B=153 as example.

To translate the RGB value into hexadecimal value, first take the value of Red (51) and divide it by 16. The balance is 3.1875. The integer, 3, will be the first number in the hexadecimal formula. The remainder (0.1875) should be multiplied by 16, which also results in the number 3. So, 51 translates to 33 in hex.

If you get integers and remainders that translate into from 10 or 15, then translate the two-digit number into a single letter (that’s where all the d’s and f’s come in), where 10=A, 11=B, 12=C, 13=D, 14=E, and 15=F. This becomes relevant to our lovely sea green when we calculate the hexadecimal equivalent of its Green value, which is 219. When we divide it by 16, we get 13.69. We translate 13 to D, and then multiply the remainder – 0.69 – by 16, and get 11, which equals B.

Repeat this formula for the Blue value, and then string them together (you should get 33DB99). 33DB99 is the RGB Hexadecimal value for the colour which can be used in the html web page.


7 Responses to “Translate and Convert RGB Color Values into Hexadecimal Hex Equivalent”

  1. aneess
    March 31st, 2009 15:38
    7

    Yeah…so long i want to get this formula.Thank you so much.

  2. Google AdSense Legacy Old Generation Code Reference (Generate and Get) » My Digital Life
    January 17th, 2009 04:03
    6

    [...] google_color_border, google_color_bg, google_color_link, google_color_text, google_color_url – Determines the color of the ad border, ad background, ad title of each ad, ad text inside the ad block, and URL at bottom of each ad. Up to 4 separate values (differentiated by commas) can be supplied for automatic color rotation when the ad is served by the Google server. The image ads does not affect by these values. Note that the color value should be converted in hexadecimal format. [...]

  3. Kevin Benefield
    January 7th, 2009 04:37
    5

    THANK YOU SOOO MUCH!!!! I lost a hex value for a color that I needed desperately! I almost paniced! But when I found this site, it worked perfectly! Thanks to whoever made this site!!!

  4. Ace Frye
    September 5th, 2008 23:29
    4

    Thank you sir, this is exactly what I was looking for. Plus, you are the top result on google when searching “how to translate rgb into hex”

  5. admin
    December 5th, 2006 18:33
    3

    Hi sorry anon, the keywords are based on what users search, and is not controllable.

  6. anon
    December 5th, 2006 18:07
    2

    It’s damn misleading to stuff the word “pantone” into you keywords when you don’t talk about it at all.

  7. Lewis Stratton
    April 11th, 2006 11:59
    1

    What a fantastic page. The web is full of ready-made converter tools, but I love to know HOW things are done. Your page on RGB to Hex conversion is well written and straightforward.

    What a bonus to DIY webmasters such as myself. Many thanks.

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. To receive notification of latest comments posted, subscribe to My Digital Life Comments RSS feed or register to receive new comments in daily email digest.
Custom Search

New Articles

Incoming Search Terms for the Article

convert rgb to pms - convert pms to rgb - pantone rgb equivalent - translate rgb to hex - rgb translator - hex color translation - colour translation - Hex translation - hex color translator - convert pantone to hex - pantone to hex converter - translate color code - rgb translation - hex to pantone converter - rgb pantone equivalent - color code translation - color translate - rgb to pms converter - hex to pantone conversion - pantone translation - pantone to hexadecimal converter - RGB color translation - colour translator - rgb to pms - convert hex to pantone - PMS to RGB converter - convert rgb value - pantone rgb converter - pms color chart converter - convert hex to pms - hex to english converter - Pantone rgb conversion - translate rgb to html - rgb value converter - convert pantone to rgb - pantone equivalent rgb - RGB PMS converter - Hexadecimal to english Converter - translate rgb to hexadecimal - Colour code translation - RGB to PMS translation - all - convert rgb to pms color - convert pms to rgb chart - convert rgb to integer - pantone to hex conversion - translate pms to rgb - color converter pantone - translate hex color - PMS color translation - translate rgb color - translate Color codes - hex colour translation - RGB color equivalent - pms rgb convert - pantone translator - rgb pantone conversion - pms color convert rgb - rgb color equivalents - convert RGB to int - hex to pms converter - rgb to pantone conversion - hex to rgb formula - rgb naar pms - rgb to pms color - pms color converter - pms to hex - translate hex colors - pantone rgb color conversion - translate rgb - pantone rgb values - rgb colour translator - converting pantone to rgb - rgb color translate - color code translate -