Register a color — $29.99

How to Find the Hex Code of a Color (From a Photo, Screen, Paint Chip or Website)

Find the exact hex code of a color with a free eyedropper on Mac, Windows, iPhone or Chrome, or look up a paint brand's published value. Then check if that shade is available and name it.

#0F6E8C · eyedropper teal · 11 min read · Updated October 24, 2026

Key takeaways

  • A hex code is a six-digit code like #FF0099: two hexadecimal digits each for red, green and blue, from 00 to FF. Case doesn't matter.
  • On a computer, use the free eyedropper that's already there: Digital Color Meter on a Mac, PowerToys Color Picker on Windows (Win+Shift+C by default), or the Eyedropper in Chrome DevTools.
  • On iPhone, Photos → Edit → Markup → color circle → eyedropper, then Sliders shows a hex value. Switch it from Display P3 to sRGB before you copy it, because web hex codes are sRGB.
  • For a paint color, use the brand's published value. Sherwin-Williams lists a hex for each color. Don't sample a phone photo of a wall, since lighting and white balance shift the pixels.
  • Official Color Registry takes six-digit hex codes, tells you live whether that exact shade is still available, and lets you name it for $29.99.

To find the hex code of a color, use an eyedropper tool on the color and copy the six-digit code it gives you (for example #0F6E8C, the color at the top of this page). Every major platform has a free one: Digital Color Meter on a Mac, PowerToys Color Picker on Windows, the Markup eyedropper in iPhone Photos, and the Eyedropper in Chrome's DevTools. For paint, fabric or anything printed, look up the maker's published value rather than sampling a phone photo, because lighting changes the pixels. Once you have the code, you can check whether that exact shade is available and name it.

The steps for each device are below, along with how to avoid the most common mistake: copying a code that's slightly off.

What a hex code actually is

A hex color code is a compact way to write a screen color. MDN, the standard web reference, defines it as the hexadecimal notation for an sRGB color: a # followed by values for red, green and blue. In the common six-digit form #RRGGBB, each pair is a number from 00 (0) to FF (255). So:

HexRedGreenBlueWhat you see
#FF000025500Pure red
#FF00992550153Hot pink
#0F6E8C15110140A deep teal
#FFFFFF255255255White
#000000000Black

A few rules from the spec that matter in practice:

  • Case doesn't matter. #ff0099 and #FF0099 are identical.
  • Shorthand exists. #F09 is short for #FF0099: each digit is doubled.
  • Some codes carry transparency. An eight-digit code such as #FF0099AA adds an alpha (opacity) pair at the end. For naming a solid color, you want the first six digits.

Six digits give 256 × 256 × 256 = 16,777,216 possible colors. That's why two shades that look the same to you can have different codes, and why it's worth sampling carefully.

Hex vs RGB vs CMYK vs Pantone: which code do you need?

CodeLooks likeUsed for
Hex#0F6E8CWebsites, apps, design tools, and naming a screen color
RGB15, 110, 140The same sRGB color written as three numbers from 0 to 255. It converts exactly to and from hex.
CMYK89, 21, 0, 45 (%)Ink percentages for print. A simple conversion from hex without a print profile is only approximate.
PantoneA named or numbered swatchPhysical color matching in print, packaging and textiles. A converter gives you the closest match, not an exact identity.

Hex and RGB are the same information written two ways. For example, red 15 is 0F in hexadecimal, green 110 is 6E and blue 140 is 8C, which gives #0F6E8C. If a tool gives you RGB, you can type those three numbers into Claim directly. CMYK and Pantone describe ink and physical swatches, so going from them to a hex always involves some approximation.

On a Mac: Digital Color Meter

macOS includes Digital Color Meter (Applications → Utilities). According to Apple's guide:

  1. Open Digital Color Meter and move the pointer over the color. The color under the pointer and its values appear in the window.
  2. Drag the Aperture Size slider down to sample a single pixel. If the aperture covers several pixels, the app averages them, which helps with a slightly grainy photo.
  3. Choose View → Display Values to change how RGB values are shown, including hexadecimal.
  4. Press Command-L to lock the aperture in place so it doesn't move when you reach for the menu.
  5. Choose Color → Copy Color as Text (Shift-Command-C) to copy the value.

Apple also notes that the values depend on the color space you pick from the pop-up menu. If you'll use the code on the web, or to register a color, pick an sRGB option so the numbers match what a browser shows.

On Windows: PowerToys Color Picker

Microsoft's free PowerToys includes a Color Picker utility. Per Microsoft Learn:

  1. Install PowerToys and turn on Color Picker in PowerToys Settings.
  2. Press Win+Shift+C (the default shortcut).
  3. Hover over the color. Scroll up to zoom in for a closer look.
  4. Left-click to pick. The color is copied to your clipboard in the default format, which is HEX, and saved to a history of up to 20 colors.

The editor also lets you fine-tune the picked color's HSV, RGB and HEX values and choose a slightly lighter or darker neighbor. Microsoft lists one limitation: wide color gamut and HDR formats aren't supported, so on an HDR display you may want to sample with HDR turned off.

In Chrome: the DevTools Eyedropper

If you're looking at a color on a website, such as a brand's logo or a product photo, Chrome's DevTools can sample it:

  1. Right-click the page and choose Inspect.
  2. In the Styles pane, click any small color square next to a color or background-color value to open the Color Picker.
  3. Click the eyedropper button (or press C) and click the color you want. Google's docs say it can sample anywhere on screen, not just inside the page.
  4. Set the display format to hex (#) and click Copy.

Google notes that the Eyedropper samples in sRGB and clips colors outside that range to the nearest sRGB color, which is what you want for a standard hex code. If the color is in the site's CSS, the Styles pane may show the hex directly, and that's the most accurate source.

On iPhone: the Markup eyedropper in Photos

iOS has a system color picker with an eyedropper. The quickest way to reach it with your own photo:

  1. Open the photo in Photos and tap Edit, then the Markup (pen) button.
  2. Tap the color circle, then the eyedropper icon.
  3. Drag the magnifier over the exact spot and let go.
  4. Open the color circle again and choose the Sliders tab to see the hex value.

One catch: the hex field can default to Display P3, the iPhone screen's wider color space. Tap the label to switch to sRGB before copying, because web hex codes (and the registry) are sRGB, and the same color has different numbers in the two spaces. Then cancel your Markup edits so the photo isn't changed.

On Android, we couldn't confirm a built-in hex eyedropper in Google Photos. The reliable route is to send the photo to a computer and use one of the tools above.

For paint, fabric and printed colors: use the published value

Photographing a painted wall and sampling the pixels is the least accurate way to get a hex code. The camera's white balance, the time of day, the paint's sheen and shadows all change the pixel values. Use the manufacturer's number instead:

  • Paint. Major brands publish screen values. Sherwin-Williams' page for Pure White SW 7005, for example, lists its hex as EDECE6, and the company offers downloadable spreadsheets with RGB and hex values for its collections. Note that one SW color-info PDF lists Pure White's RGB one step different (238, 237, 231), so two official sources can disagree by a hair.
  • Pantone. Pantone Connect can convert between Pantone colors and hex, RGB and CMYK. Pantone's own support pages say its published RGB and hex values are digital approximations and can differ from the printed guides because of measurement conditions. For what Pantone is and isn't, compared with a registry, see Pantone vs a color registry.
  • Brand colors. Many companies publish official hex values in a brand or press kit, which beats sampling a logo.

For any physical color, the hex is a stand-in for how it looks on screen. That's fine for picking and naming a shade, as long as you know your screen and someone else's may render it a little differently.

How to sample accurately (and avoid an "almost" code)

  • Zoom in first. Edges are blended with whatever is next to them (anti-aliasing), so sample the middle of a flat area.
  • Avoid highlights and shadows on fabric, skin, water or a glossy object. Sample a few spots and pick the one that looks right.
  • Average a small area on grainy photos. Digital Color Meter's larger aperture does this automatically.
  • Use the original file, not a screenshot of a compressed copy from a messaging app, since compression shifts colors slightly.
  • Stay in sRGB. If a tool shows Display P3 or another color space, switch to sRGB before you copy.
  • Check the result. Paste the code into a browser color preview, or into Claim, and compare it with the original side by side.

Once you have the hex: check it and name it

A hex code is a number. What it means to someone, such as the blue of a childhood bedroom, the green of a first car or the exact pink of a wedding bouquet, is what a name captures. On Official Color Registry:

  1. Go to Claim and paste your six-digit code. Claim accepts it with or without the #, and you can also type RGB values or drag the picker.
  2. Claim checks live whether that exact hex is still available. Each of the 16.7 million six-digit codes can be registered only once. If it's taken, you'll get a link to the existing registration plus nearby available shades, often only a step or two away.
  3. Give it a name and a dedication, and register it for $29.99. You get a certificate and a public registry entry with its own page.

Want to see what a shade looks like on its own first? Every hex has its own page at /color/<hex>, for example /color/0f6e8c, that says whether anyone has registered it yet. For the full walkthrough, read how to register a color name, and for background on the industry, see who names colors.

The Official Color Registry (OCR) is an independent, privately run registry. It is not a government agency or an international standards body, and registering a color name does not give you a trademark or ownership of the color itself.

Name a color

Choose a color, name it, add a dedication, and receive a certificate and an entry in the public registry. From $29.99.

Register a color

Frequently asked questions

What is a hex code for a color?

A hex code is a way of writing a screen (sRGB) color as six hexadecimal digits after a #, for example #FF0099. The first pair is red, the second green and the third blue, and each pair runs from 00 (none) to FF (full). That gives 256 × 256 × 256 = 16,777,216 possible six-digit codes. Letters can be upper- or lowercase: #ff0099 and #FF0099 are the same color.

How do I find the hex code of a color in a photo?

Open the photo on a computer and use a free eyedropper. On a Mac, use Digital Color Meter (in Utilities); on Windows, PowerToys Color Picker (Win+Shift+C by default) copies the hex to your clipboard. On an iPhone, open the photo in Photos, tap Edit, then Markup, tap the color circle, use the eyedropper and open Sliders to see the hex. Zoom in and sample a clean, evenly lit area, not an edge or a highlight.

How do I get the hex code of a paint color?

Look it up on the paint brand's site instead of photographing the wall. Sherwin-Williams, for example, publishes a hex value for its colors (Pure White SW 7005 is listed as EDECE6) and offers downloadable spreadsheets of RGB and hex values. Treat any paint hex as an on-screen approximation, because paint looks different under different light.

Why does the hex code I picked look different from the real thing?

A hex code describes a screen color, and three things shift it: the light and camera settings when a photo was taken, the color space (an iPhone's picker can show Display P3 values, while web hex codes are sRGB), and your screen's own calibration. Pantone notes that even its own published RGB and hex values are digital approximations that can differ from physical color guides.

Can I register a color by its hex code?

Yes. On Official Color Registry's Claim page you can paste a six-digit hex code (with or without the #), type RGB values, or drag the picker. Claim checks live whether that exact hex is still available, because each one can be registered only once, and suggests nearby available shades if it's taken. Naming it is $29.99. The Official Color Registry (OCR) is an independent, privately run registry. It is not a government agency or an international standards body, and registering a color name does not give you a trademark or ownership of the color itself.

What about three-digit or eight-digit hex codes?

CSS also accepts a three-digit shorthand (#F09 means #FF0099) and versions with a transparency (alpha) value (#RRGGBBAA). For registering a color, use the full six-digit form: expand the shorthand by doubling each digit and drop any alpha digits.

Sources

Keep reading