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.


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

  1. 596573
    November 8th, 2009 19:43
    8

    4655434B

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

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

  3. 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. [...]

  4. 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!!!

  5. 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”

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

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

  7. 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.

  8. 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

hex color translator - convert RGB to PMS - hex to pms - rgb to pms conversion - RGB translation - translate rgb to hex - pantone translation - hex color translation - color code translator - hex to pms converter - rgb translate - translate to rgb - convert rgb to integer - hex to pms conversion - pantone 5045 translate - pantone to hex converter - translate rgb to hexadecimal - convert pms to rgb - convert hex to pantone - convert pantone to hex - rgb translator - translate rgb to pantone - hex color translate - color translation PMS to RGB - pms color conversion - color translater - pms to rgb conversion - rgb color translator - translate rgb to html color - pantone rgb translation - pantone equivalent rgb - translate rgb - convert rgb to int - covert hexadecimal value into rgb format - convert pms color to hex - hex pms converter - pantone color translator - hex colors translator - pms colors into hex colors - 715 HEXADECIMAL - convert pantone black 7 y hexadecimal - hex to rgb formula - convert pantone color to hex value - how to translate rgb to hex - pantone rgb equivalent - pms converter - translate into hexadecimal - translate to hex value - online pms hex equivalent - color html RGB translate -