How to find the hex code of a color in an image
- Add your image. Drag it onto the page, click Choose image, or copy an image and press Ctrl+V (⌘+V on Mac). Photos, logos, screenshots and artwork all work.
- Read the palette. Hex From Image finds the main colors and lists each one with its hex code, RGB and HSL values, closest color name, and how much of the image it covers.
- Pick an exact pixel. Need the color of one specific spot, like a logo's background or a button? Click it on the image. The exact hex code appears under the image and is copied to your clipboard.
- Use your colors. Click any color to copy it, copy the whole palette as a list or CSS variables, or download it as an image.
What is a hex color code?
A hex color code is a six-character way to write a color for screens, used in web design, CSS, and apps like Figma, Canva and Photoshop. It starts with # followed by three pairs of characters: one each for red, green and blue.
Each pair runs from 00 (none) to FF (full), using base-16 digits 0–9 and A–F. So #FF0000 is pure red, #000000 is black, #FFFFFF is white, and #FF5733 is a bright orange-red. That gives 16.7 million possible colors, and every one has its own code.
HEX vs RGB vs HSL
All three describe exactly the same color; they're just different notations. Use whichever your tool asks for.
| Format | Example | Best for |
|---|---|---|
| HEX | #FF5733 | CSS, HTML, design tools, sharing a color quickly |
| RGB | rgb(255, 87, 51) | Code and apps that take red, green, blue values from 0–255 |
| HSL | hsl(11, 100%, 60%) | Adjusting colors by hand: hue, saturation and lightness are intuitive to tweak |
Frequently asked questions
How do I find the hex code of a color in an image?
Upload or paste the image into Hex From Image. It lists the main colors with their hex codes automatically. To identify one specific spot, click it on the image and its exact hex code is shown and copied.
Is my image uploaded to a server?
No. Hex From Image reads the image directly in your browser. The file is never uploaded, stored or seen by anyone else.
Which image formats are supported?
JPG, PNG, WebP, GIF, BMP, SVG and AVIF work in all modern browsers. iPhone HEIC photos work in Safari; in other browsers, convert them to JPG first.
Why are the palette colors slightly different from what I picked?
The palette groups similar shades together and shows a representative color for each group, which is ideal for photos. Clicking the image gives you the exact value of a single pixel instead.
What is the difference between HEX and RGB?
They describe the same color in two notations. RGB lists the red, green and blue values from 0 to 255, such as rgb(255, 87, 51). HEX writes those three values in base 16, such as #FF5733.