• ARTICLES
• SUBSCRIBE
SEARCH

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

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:

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.

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.

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

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

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:

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

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

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

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.

Programmer by day, geek by night, The Geek, also known as Lowell Heddings, 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

1. Rohit

Great tip!
Simple and effective!

2. Brent

Don’t hate on paint; it is a very useful application. I have found that MS paint handles old-school image types very well and will open some of them better than the application they were intended for originally. Simple is good sometimes :D

3. Josh

It is possible to use base 10 colors on a web page. It’s just ‘rgb(13,37,153)’.

4. The Geek

@Josh

Of course. I probably should have included that in the article… this was more about how to convert them than anything else =)

5. ph15h

paint? =/ I haven’t used that since I got XP. Then now on Vista, I only opened it once, and that was by accident. Nice trick for conversion though. Thx!

Paint.net or GIMP are nice free legal alternatives

6. Thomas Murphy

Great info, thanks!

7. Zac

Awesome site, thanks so much!

8. Syahid A.

Truly a geeky way! I use Pixie for this needs.

9. chloe

do you know how to get colour codes (html) on windows live 9.0 2009
eg; coloured names?
thankyou (: x

10. Tyler

This is crazy. It is really GEEK, but not stupid. It is called genius.

11. Nina

OMG tysm! Ihave been looking at color codes online but could never get exact colors I wanted. I didn’t now you could do this, so thank you :–)

12. Eric

I’ve been pulling my damn hair out trying to figure out how to convert the microsoft paint colors into html code. Thanks so much!!

13. Israelpro

This is sooo awesome!!!!!!!!!

14. wolf

How about using this for converting RGB to decimal and so on?
http://www.1728.com/colrchr4.htm

15. Kari

The radio hex thing? SO CONFUSING!!!!! I don’t get it at all

16. Ryan

Awesome tip, thank you! I’ve always wondered how to do this…Only thing I noticed is that on Windows 7, the latest version of the calculator needs to be put in “programmer” mode, not scientific.

17. Jill

Wow, thanks! This is great!

18. Steph

Thank you so much :-)

19. Von

Thanks, dude! I hadn’t even known the MS calculator could do that… *shameface*

20. Manny

No need to open calculator to do the Hex conversion.
Just paste the command in google.
For example:
for getting 13 in decimal to hex, search in google: 13 to hex.
You will get answer as OxD. The part after the x is the hex value of 13.

Google has a lot of converter/calculator capabilities inbuilt.

Thanks

21. Yaface

ok then….