Get the HEX code of a colour in an image
Point at a pixel and copy its HEX code, ready for CSS, Figma, Canva or a brand guide.
- Nothing is uploaded
- Works offline after first visit
- Open source
- No watermark · limit is your device’s memory; phones hold less
Find the HEX code of any colour in an image. Point at a pixel, copy #RRGGBB, RGB or HSL. It is free, needs no account and adds no watermark, and your files are not uploaded: everything runs in your browser on your device. The size limit is your device’s memory, and phones hold less; give the page a short while after one visit to save itself for offline use, and then it works offline.
- HEX
#FFFFFF- RGB
rgb(255, 255, 255)- HSL
hsl(0, 0%, 100%)
Picked
Click or tap the image to keep a colour here.
Main colours in this image
Done
Open the network tab. Your files never appear in it.
Add files and run the tool to see every request this tab makes.
Your files are processed on this device and never sent to a server. Reload the page to clear everything from memory.
A HEX code, like #1A73E8, is how the web, most design tools and brand guides write a colour: a # followed by two hexadecimal digits each for red, green and blue. Drop an image here, point at the colour you want and its HEX code is on the card, one click from your clipboard.
The same card shows the RGB and HSL forms. RGB is what many apps and print briefs ask for; HSL (hue, saturation, lightness) is handy in CSS when you want a lighter or darker version of the same colour. The card itself is painted in the colour, with black or white text picked for contrast.
Nothing is uploaded: the page reads the pixel from a canvas in your browser tab. Logos, client work and screenshots of private apps stay on your device.
The copied values are ready to paste as they are. HEX comes as #1A73E8, RGB as rgb(26, 115, 232) and HSL as hsl(214, 82%, 51%), the forms CSS accepts directly. In Figma, Canva and most other design tools, paste the HEX into the colour field; the # is accepted with or without. For a brand guide, list the HEX and RGB together, since some tools and suppliers ask for one and some for the other.
To check a colour you have been given, such as a logo’s HEX from an old brand guide, pick it from a flat area of the original PNG export, well away from edges. Pixels along an edge are blended with the background and give a slightly different code. Picking two or three spots from the same flat area and getting the same code tells you it is exact.
How it works
- Drop the image, or tap to pick one.
- Point at the colour. The magnifier helps you hit the exact pixel on a thin line or small text.
- Copy the HEX code. Click to keep several and copy each in turn.
In your browser, not on a server
Your browser decodes the image (libheif or the Squoosh decoders step in for HEIC, AVIF and JPEG XL) and draws it on a canvas in your tab. The colour under the cursor is read straight from that canvas, one pixel at a time, at up to 4096 pixels across, so a pick matches the file exactly. The main colours come from k-means clustering over a sample of about 20,000 pixels, run in the page with a fixed seed so the same image always gives the same palette.
Compared with upload-based tools: Colour pickers online upload the picture to show it back to you, which is a strange trade for a screenshot of a client’s unreleased design or a photo from your phone. Browser extensions that pick colours can read every page you visit. Here the image never leaves your device, and there is nothing to install.
Verify it yourself. Give the page a short while after one visit to save itself for offline use, then turn off Wi-Fi or switch to airplane mode and run the tool again. Or open your browser's developer tools (F12, or Cmd-Option-I on a Mac), pick the Network tab, and watch it while you convert. The panel above does the same count for you.
Questions
Are HEX codes upper or lower case?
Either works everywhere: #1A73E8 and #1a73e8 are the same colour. This page shows upper case because it is easier to read.
What about transparent pixels?
Colours are shown as they look on white. A half-transparent red in a PNG reads as a pink, which is what you would see on a white page.
Can I get the short three digit form, like #FFF?
The page always shows the full six digits. A code can be shortened only when each pair repeats: #FFFFFF is #FFF and #336699 is #369. Most colours picked from a photo, like #1A73E8, have no short form. Both forms work in CSS, so there is rarely a reason to shorten it.
Which HEX do I get from a gradient or a photo?
The exact pixel under the crosshair, so a pick in a gradient depends on where you point. For a single code that stands for a whole area, use the strip of main colours under the image: clicking one of those swatches copies its HEX, which is an average of every pixel it covers.
Is the file uploaded anywhere?
No. There is no server in this process. The page is a static file and the work is done by code running inside your browser tab. Give the page a short while after one visit to save itself for offline use; then you can turn off Wi-Fi and it still works.
More image tools
Color picker from image
Point at any pixel to get its HEX, RGB and HSL code, and see the main colours of the picture. The image stays on this device.
Compress PNG
Shrink PNG screenshots, logos and graphics while keeping them PNGs, transparency and all. Nothing is uploaded.
Remove EXIF Data
See what a photo reveals, then delete it. The image data is copied unchanged and only the metadata is removed; a sideways JPG is re-encoded only if Apply orientation is on.
EXIF Viewer
Drop a photo to read its metadata, including the location it was taken. The file is read on this device, so checking a private photo does not share it.
Other conversions
- HEIC to PNG
- HEIF to JPG
- PNG to JPG
- JPG to PNG
- WebP to PNG
- WebP to JPG
- PNG to WebP
- JPG to WebP
- AVIF to JPG
- AVIF to PNG
- Color picker from image
- Color palette from image
- Email QR code
- Scan a QR code from an image
- QR code scanner for PC
- Barcode scanner online
- Resize image
- Resize PNG
- Compress image to 20 KB
- Compress image to 50 KB
- Compress image to 100 KB
- Compress image to 1 MB
Guides
- How to get a color code from an imageMatching 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.