Subscribe to How-To Geek

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:

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.

The Geek is the founder of How-To Geek and a geek enthusiast. This article was written on 06/3/08 and tagged with: The Geek Blog

Daily Email Updates

You can get our how-to articles in your inbox each day for free. Just enter your email below:


Comments (10)

  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.


Leave a Comment




Leave your friendly comment here.

If you have a computer help question, click here to leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Sponsored Links
Getting Started
About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
Cmd.exe
Dpupdchk.exe

Copyright © 2006-2008 HowToGeek.com. All Rights Reserved.