inyourbrowser.com

Get Hex Color from Image

Drop an image, click a pixel, and read its hex color. The tool also shows RGB and HSL values, keeps a history strip of your recent picks, and gives every swatch a copy button. All processing runs in your browser using the Canvas API.

Drop an image or click to choose

JPG, PNG, WebP, GIF, SVG, AVIF. Stays in your browser.

CURRENT PICK

Choose an image to begin.

HOVER

Hover over the image.

ACTIONS

Runs entirely in your browser

How it works

The tool draws your image to a hidden HTML canvas at its natural resolution. When you click a pixel, the Canvas API call ctx.getImageData(x, y, 1, 1).data returns the exact RGBA bytes. Those bytes are formatted as hex, RGB, and HSL, and the color is added to a small history strip of recent picks.

Processing runs in your browser

All color sampling happens locally in your browser tab using the Canvas API. Our servers are not involved at any point.

Frequently asked questions

Is my image uploaded to a server?
All hex sampling runs in your browser using the Canvas API. Our servers are not involved at any point.
Why is the hex code useful?
Hex codes are the standard way to specify colors in CSS, design tokens, and most graphics formats. A six-digit hex like #2563eb maps directly to an RGB color.
How do I copy a hex code?
Click the Copy hex button next to any swatch. You will see a Copied! confirmation for a moment, then it returns to the default label.
Does the picker work with PNG transparency?
Yes. The tool reads the RGBA bytes from the pixel under your cursor, so it returns the visible color. Fully transparent pixels return the canvas background.
Can I sample colors from very large images?
Yes. The image is drawn at its natural resolution to a hidden canvas, and the display scales down to fit your screen. Click positions are mapped to source pixels automatically.

Related tools

Color converter
Convert HEX, RGB, and HSL color values instantly. Live preview swatch included.
Color palette generator
Generate complementary, analogous, triadic, and monochromatic color palettes. Copy hex, RGB, or CSS variables.
Contrast checker
Check WCAG AA/AAA contrast ratios between two colours. Live pass/fail results.
CSS gradient generator
Build linear, radial, or conic CSS gradients visually. Live preview and one-click copy.