Get the hex code of any pixel on your Mac

macOS has a built-in tool for this: Digital Color Meter, in Applications › Utilities. Set it to show hexadecimal values in sRGB, point at the pixel, and read the code. If you want one click and the code on your clipboard, a menu bar color picker like Hex Marks the Spot does it.

The built-in way: Digital Color Meter

Digital Color Meter comes with every Mac. It shows the color under the pointer as numbers. Set it up once:

  1. Open Digital Color Meter from Applications › Utilities, or search for it with Spotlight.
  2. In the window, open the pop-up menu and choose sRGB. That is the space of web and CSS codes. The values shown depend on the color space you choose.
  3. Choose View › Display Values and pick the hexadecimal format.
  4. Drag the Aperture Size slider to the smallest size, so it measures a single pixel. Larger sizes average the pixels inside the square.
  5. Move the pointer over the color and press ⌘L to lock the position. (⌘X locks only the horizontal position, ⌘Y only the vertical.)
  6. Choose Color › Copy Color as Text, or press ⇧⌘C.

Menu names and shortcuts are from Apple’s Digital Color Meter User Guide.

What it costs you: the app has to be open each time, you have to switch it to hex and sRGB, and the aperture follows the pointer until you lock it with ⌘L. For one color now and then, that is fine.

For a color on a web page there is one more built-in option: the developer tools of your browser. Some browsers show an eyedropper in the color picker of their developer tools.

With Hex Marks the Spot: point, click, paste

Hex Marks the Spot is a color picker that lives in the menu bar. A pick goes like this:

  1. Click the eyedropper in the menu bar, or press ⌃⌥9 (Control-Option-9) in any app.
  2. A zoomed magnifier shows the pixels around your pointer, enlarged with a grid and a live color code. Move it until the outlined pixel sits on your color.
  3. Click. The code is on your clipboard in the format you choose. Press Escape or right-click to call off the search.
  4. Paste it into your stylesheet, design file or message.
Screenshot of the magnifier over a drawing of a cove: the round lens rests where the turquoise lagoon meets the deep-blue sea and shows both enlarged under a grid, the middle pixel outlined, with its code #167889 on a pill and a round sample of the color beside it. A small boat lies in the shallows by the beach.
The app’s real magnifier over a demo picture of a cove. The outlined pixel is the one a click would pick.

A few things worth knowing:

  • Ten formats. HEX with or without #, RGB values, RGB percentages, CSS rgb(), CSS hsl(), HSB, CMYK, SwiftUI Color and NSColor.
  • sRGB codes. Colors are stored as sRGB, so a hex code matches what CSS expects. No color space to set first.
  • History. Every color you pick goes into your history, so the last find is still there after you copy the next one.
  • Every display. It works on every connected display.
  • Screen Recording. The magnifier needs the macOS Screen Recording permission to read the pixels around your pointer. The app explains why and shows you how to allow it. Without it, you can still pick colors with the basic system picker.
  • Privacy. Nothing from your screen is saved or sent.

Tips and edge cases

  • Retina displays. On a Retina display one pixel of an image can cover several pixels of the screen, and when an image is shown larger or smaller than its original size, neighboring pixels blend. Pick from the middle of a flat area, not near a change of color.
  • Color profiles. A design file in Display P3 or with its own profile can show a slightly different color than its sRGB code. If a code differs from the file, check which color space each side uses before you blame the picker.
  • Text. The edges of letters are smoothed with in-between colors. To get the color of text, zoom in on a thick stroke and pick its center.

Common mistakes

  • Reading values in the wrong color space. Digital Color Meter shows values in the color space chosen in its pop-up menu. Choose sRGB for a code that matches CSS.
  • Picking an edge pixel. A pixel on a border or a letter edge is a mix of two colors. Pick inside the area.
  • The # in the wrong place. Some fields want #3CB371, others only 3CB371. Hex Marks the Spot offers HEX with and without #, so pick the one your tool expects.

Which one to use

Digital Color Meter is built into macOS and costs nothing extra. For an occasional color it does the job, as long as you set it to hex and sRGB.

Hex Marks the Spot suits you when you pick colors often: one click or shortcut from any app, the code on your clipboard in your format, and a history of what you found. It is a one-time purchase, no subscription.

Questions

Does macOS have a built-in color picker?

Yes. Digital Color Meter in Applications > Utilities shows the color under the pointer. Set View > Display Values to hexadecimal and the color space pop-up menu to sRGB to read a hex code you can use in CSS.

Why does my picked hex code not match my design file?

Usually the color space. Digital Color Meter shows values in the color space chosen in its pop-up menu; for a code that matches CSS, choose sRGB. Other causes: an edge pixel that blends two colors, or an image that was scaled. Hex Marks the Spot gives sRGB codes, the same space CSS uses.

Does Hex Marks the Spot need the Screen Recording permission?

Only for the zoomed magnifier, which reads the pixels around your pointer. The app explains why and shows you how to allow it. Without it, you can still pick colors with the basic system picker. Nothing from your screen is saved or sent.

Does it work on an external display?

Yes. Hex Marks the Spot works on every connected display.

Every pixel, one click from the menu bar

Get Hex Marks the Spot on the Mac App Store. One-time purchase, no subscription. Requires macOS 26 or later.

Download on the Mac App Store

Or look around first: everything the app does.