How to get a color code from an image

Matching a color you see in a photo needs an eyedropper, which most photo viewers do not have built in. Here is what actually gets the exact code.

Updated · 1 min read

Why you can't just guess a color code

Two shades that look almost identical to the eye can have noticeably different hex codes, and matching a brand color, a paint swatch or a design element exactly needs a tool that samples the actual pixel value rather than a visual estimate.

On a Mac

The built-in Digital Color Meter app (in Applications, Utilities) shows the RGB value under the cursor anywhere on screen, including over an open image. It is accurate but shows raw values rather than a convenient hex code, and it is a separate app most people don't know exists.

On Windows

Windows has no built-in eyedropper for an arbitrary open image; the closest built-in option is the color picker inside Paint (choose the eyedropper tool, click a pixel, then check the color properties for its code), which requires opening the image in Paint specifically.

On an iPhone or Android

Neither platform's Photos app includes an eyedropper or color-code tool. Some design apps include one, but that means installing something just for an occasional lookup.

A browser eyedropper with a magnifier

Stayput's color picker from image tool drops in a photo and shows a magnified view so you can point at the exact pixel, then copies its HEX, RGB or HSL code. It also extracts the image's main colors as a palette, and works the same way on a phone or a computer, all in the browser without uploading the photo.

Questions

What is the difference between HEX, RGB and HSL?

They are different ways of writing the same color: HEX is a six-digit code used mainly in web design, RGB gives separate red, green and blue values, and HSL describes hue, saturation and lightness, which is sometimes more intuitive for adjusting a shade.

Can I get a color code from a photo on my phone?

Yes, with a browser-based eyedropper tool; neither iPhone nor Android has a built-in way to do this from the Photos app.

How accurate is a screen color picker?

It reads the exact pixel value as displayed, which is accurate for that image and device, though the same color can render slightly differently across screens with different color calibration.

Can I get a full palette of colors from an image, not just one pixel?

Yes, a tool that extracts the main colors from an image gives a small palette representing its dominant shades, useful for matching a design to a photo's overall look.

Tools mentioned in this guide

More guides