← Back to Blog

Design & Creative | Published Aug 21, 2026 | Updated Oct 13, 2026 | 6 min read

How to Copy a Hex Color Code on Windows (and Save It)

By Khushi Yadav

How to Copy a Hex Color Code on Windows (and Save It) — Edge Drop Guide

To copy the hex code of any color on your Windows screen, install Microsoft PowerToys, press Win+Shift+C and click the pixel: Color Picker copies the color to the clipboard in HEX by default. On Copilot+ PCs, Snipping Tool has a built-in Color picker that does the same. If the color comes from a web page, copy the exact value from the browser's DevTools instead of sampling pixels.

A hex code is just text, so once it's on the clipboard you can paste it anywhere. The second half of the job is keeping it: the clipboard holds only your latest copy, so paste the code into a palette or tokens file before you copy anything else.

Option 1: PowerToys Color Picker (any Windows 10 or 11 PC)

Color Picker is part of PowerToys, Microsoft's free utility set.

  1. Install PowerToys and make sure Color Picker is turned on in PowerToys Settings.
  2. Press Win+Shift+C (the default activation shortcut).
  3. Move the cursor over the color. Scroll up to zoom in on the area under the cursor.
  4. Left-click to pick. The color is copied to the clipboard, saved to the color history, and the editor opens.
  5. Paste the code where you need it with Ctrl+V.

By default, a scroll-wheel click picks the color and closes Color Picker without opening the editor, and a right-click cancels. You can reassign these under Mouse actions in Color Picker's settings.

Useful Color Picker settings

SettingWhat it changes
Activation shortcutThe key combination that starts Color Picker
Activation behaviorOpen editor first, or Pick a color first
Default color formatThe format copied to the clipboard (HEX unless you change it)
Color formatsWhich formats the editor shows, plus your own custom formats
Show color nameAdds a rough name such as "Light Green"

The editor keeps your last 20 picked colors. You can fine-tune a color there, copy it in any enabled format, or right-click a color and select Export to save the whole history.

Copy a hex code in a custom format

If your project wants a different string, add a custom format under Color formats. Microsoft documents placeholders such as %Re, %Gr and %Bl for red, green and blue, with formatters such as X for two-digit uppercase hex. For example:

  • #%ReX%GrX%BlX gives an uppercase hex code with a leading #.
  • %Rex%Grx%Blx gives lowercase hex with no #.
  • rgb(%Re, %Gr, %Bl) gives a CSS rgb() value.

After changing the format, paste once into Notepad to confirm the exact string before it ends up in a stylesheet.

Picking the resting color of a button

Hovering over a button often changes its color. Microsoft's tip: move the pointer close to the element but not over it, scroll up to zoom (the zoomed image freezes), then pick the element's color inside the enlarged area.

Limits to know

  • Color Picker can't draw on top of the Start menu or Action Center, but picking still works there.
  • If the app you're sampling runs as administrator, the shortcut won't work unless PowerToys also runs as administrator.
  • Wide color gamut (WCG) and HDR formats aren't supported, so samples taken on an HDR desktop may not match the source color. Why HDR screenshots look washed out explains the same mismatch for screenshots.

Option 2: Snipping Tool's Color picker (Copilot+ PCs)

Microsoft's Snipping Tool support page lists a Color picker that captures exact color values from anywhere on screen and copies them to the clipboard. The same page says it's available only on Copilot+ PCs (Windows 11 AI+ PCs). On other PCs, use PowerToys.

Option 3: Browser DevTools for colors on a web page

If the color is defined in a site's CSS, copy the value instead of sampling pixels. A sampled pixel can be off by a digit or two because of anti-aliasing, gradients or image compression.

  1. Right-click the element and select Inspect (or press F12) in Edge or Chrome.
  2. In the Styles pane, find the color, background-color or border-color declaration.
  3. Select the value and press Ctrl+C.

The Computed tab shows the final value after the cascade, which helps when a variable or preprocessor sets the color. Browser DevTools copy options covers the other copy commands DevTools offers.

Option 4: The eyedropper in your design app

Photoshop, Illustrator, Figma and most other editors have their own eyedropper. Use it when the color lives in a file you have open: it samples the document, not the screen. Copy the hex value from the app's color field when you need it elsewhere. If all you have is a screenshot, picking colors from a copied screenshot walks through doing it accurately.

How to keep the hex code after you copy it

The clipboard holds one item, and your next copy replaces it. Choose where the code lives by how long you need it.

How long you need itWhere to keep it
The next pasteThe clipboard is enough
The rest of the dayWindows clipboard history (Win+V), once it's turned on
Past a restartPin it in Win+V; pinned items survive a restart
For the projectA tokens file, stylesheet variables or your design tool's color variables
For a PowerToys sessionThe Color Picker editor history; export it if it matters

Windows clipboard history is off until you press Win+V and select Turn on. Unpinned items are cleared when the PC restarts, so pin the items in clipboard history that you'll need tomorrow. Pins have no names, though, so a code like #0F172A is hard to recognise a month later.

For anything you'll reuse, paste the code into a named variable, such as --color-surface: #0F172A; in a CSS file or a color variable in Figma. Hex lists or swatches compares the ways to store a whole palette.

Format checks before you paste

  • With or without #: some fields want #RRGGBB, others only RRGGBB. Check what your picker copies and adjust the format.
  • Alpha: #RRGGBBAA has eight digits. Strip the last two if the destination accepts only six.
  • Case: #0f172a and #0F172A are the same color. Pick one style per project.
  • Other formats: rgb(15, 23, 42) is the same color as #0F172A. Convert before pasting into a field that accepts only hex.

Keeping copied colors in Edge Drop

If you copy a lot of colors during a day, Edge Drop](/), the free clipboard manager made by the team behind this site, recognises hex codes (#RGB, #RRGGBB and #RRGGBBAA) as you copy them. Its Colors filter also picks up rgb() and hsl() text, so you can list every color you copied recently and click one to paste it again. History survives restarts unless you turn on Clear unpinned on restart. See [how to filter text, links, images and files for the filter tabs.

FAQ

Does Windows 11 have a built-in color picker?

Only on Copilot+ PCs, where Snipping Tool includes a Color picker. On other Windows 11 and Windows 10 PCs, PowerToys Color Picker is Microsoft's free option.

Why doesn't my sampled hex match the CSS?

A screen picker reads the rendered pixel, which can be a blend of neighbouring colors at an edge or in a gradient. Zoom in and sample a solid area, or copy the value from DevTools.

Can I copy RGB instead of hex?

Yes. In PowerToys, change Default color format to RGB or another format, or copy a different format from the Color Picker editor.

Related reading

Sources

Khushi Yadav
Written by Khushi Yadav · Author & Content Writer

Khushi Yadav writes Edge Drop's workflow and design guides and is a B.Tech Computer Science Engineering student. Khushi's posts are checked against Microsoft's documentation and the Edge Drop fact sheet.

GitHub · LinkedIn

Copy. Stack. Drop.

Transform your clipboard into an interactive edge shelf. Stack, pin, and drag assets into any app with zero friction.

Download for Windows Get from Microsoft Store

How to Install Guide · First 10 Minutes Guide · Drag & Drop Guide · Edge Drop vs Win+V · Support

Free · Lightweight · Privacy First
Find us on CodeHype