Stupid Geek Tricks: Figure Out HTML Color Codes from Decimal RGB Colors (Like MS Paint Uses)

By Lowell Heddings on June 3rd, 2008

If you have ever needed to get an HTML color code from an application that only has the Windows color picker, you might have wondered how to convert that over to an HTML color code. Sure, you can use a color picker application, but there’s also a simple way to do it without any additional software.

One example of an application that only has the standard color picker is the pathetic Paint application included in Windows:

image

Find the HTML Hex Color Code

If you are looking at the standard Windows color picker dialog, you’ll see the Red, Green, Blue on the right-hand side, which is always in decimal.

image

The first thing you’ll want to do is open up Calculator, and then put it into Scientific mode using the View menu. We’ll use this to convert those decimal codes to Hexadecimal.

image 

First we’ll enter in the first number (for Red) while making sure the radio button is set to Decimal:

image

Click on the radio button for Hex and you’ll get the first part of the hex code:

image

Note that if you get a single number or letter you should precede it with a 0. In this case the code would be 0D.

Now that we’ve got the first part of the code, we’ll flip the radio button back to decimal and add in the second value for Green:

image

We flip the radio button to Hex again and we have the second part of the code:

image

Now the code is 0D25, so let’s find the third part by entering in the blue decimal value:

 image

And now we have the third part of the color after clicking Hex:

image

So now the full color code is #0D2599, which can be used when editing your html/CSS files… and you also learned how to convert decimal to hex. Here’s an example using the color:

BLUE!

Of course, this technique works anytime you know the decimal RGB codes for a color, not just from MS Paint.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 06/3/08
More Articles You Might Like

Enter Your Email Here to Get Access for Free:

Go check your email!