1. Computing & Technology

Discuss in my forum

How To Convert From RGB to Hex in Windows 7

By , About.com Guide

Color for web pages is often expressed as a hexadecimal triplet (for example: #ffffff means white or RGB(255,255,255) and most graphics software describe colors in RGB. But most of us don't have the ability to convert base 10 to base 16 (hex) in our heads. But it's simple to convert an RGB code into a hexadecimal triplet for your web page using the Windows calculator.

Difficulty: Easy
Time Required: 5 minutes

Here's How:

  1. Choose an RGB color you would like to convert. For example, a golden yellow in RGB is (177,102,0).
  2. Open the calculator. In Windows 7 type “calculator” into the “Search programs and files” box and choose the calculator.
  3. In the view menu, change it to “Programmer.”
  4. Make sure that the “Dec” radio button is selected.
  5. Enter the first number in the RGB code into the calculator. In my example, that would be 177.
  6. Click on the “Hex” radio button.
  7. Record the code that appears as your first two digits of your hex-triplet. In my example, that would be B1. So your color starts as #B1.
  8. Repeat with the two remaining RGB numbers. For my example, I get 66 and 00. My resulting hexadecimal code is #B16600.

Tips:

  1. I strongly recommend you only use browser-safe colors. These are colors that display accurately on more browsers and platforms.
  2. With CSS you can define colors using the RGB codes. You write color: rgb(177,102,0) rather than the hexadecimal code.
  3. In older versions of Windows, the hexadecimal converter is in the “Scientific” calculator, rather than a separate “Developer” calculator.

What You Need

  • Windows 7 Calculator

©2012 About.com. All rights reserved.

A part of The New York Times Company.