How Do I Get the Hex Code from an Image?

✓ 100% FREE — No Signup Needed

Wondering how to get the HEX code from an image? Upload any photo below, click a pixel, and copy its exact code — or pick and convert colors by hand, build palettes and check contrast. Everything happens in your browser.

Color converter

Tap the circle or enter a HEX value.

TAP TO PICK

CMYK is an on-screen approximation. Printed output varies by printer, ink and color profile.

Contrast checker

Test text against a background using WCAG ratios.

Readable design starts here.Preview normal and large text together.
Contrast ratio—
AA normalAA largeAAA normalAAA large

Pick a color from an image

Upload a photo and click any pixel to get its exact HEX code.

No image loaded yet. Choose a photo, then tap any spot on it to read that pixel's color.

Private by design: your photo is read inside your own browser and never uploaded anywhere.

Palette generator

Each harmony follows your selected base color. Tap a swatch to copy it.

Tints & shades

Tap any tone to copy its HEX code.

WHITEBASE
BASEBLACK

How do I get the HEX code from an image

It takes three taps — no design software needed:

  1. Upload the photo in the "Pick a color from an image" panel above.
  2. Click the exact pixel whose color you want — a logo, a wall, a shirt, anything.
  3. Copy the HEX code (RGB, HSL and CMYK appear too) and paste it into your design.

The sampling happens on a canvas inside your own browser, so your image is never uploaded anywhere — safe even for private photos. Designers use this to match brand colors from screenshots, pick wall-paint shades from room photos, and grab exact tones from inspiration images.

Which color format should you use?

Different formats describe the same color for different workflows.

  • HEXCompact and widely used in web design and CSS.
  • RGBRed, green and blue channels for screens and digital graphics.
  • HSLHue, saturation and lightness—often easier for adjusting color families.
  • CMYKCyan, magenta, yellow and black—a practical preview for print workflows.

Quick answers

How do I get the HEX code from an image for free?

Upload the image in the "Pick a color from an image" panel above, click the exact pixel you want, and copy the HEX code. Free forever, no signup, and your photo never leaves your device.

How do I get the HEX code from an image without uploading it anywhere?

This tool samples pixels with a canvas inside your own browser — nothing is sent to any server. It is the private way to read a color from a photo, screenshot or logo.

How do I convert HEX to RGB?

Enter or select a HEX color above. Its red, green and blue values appear instantly in the RGB field.

What is a good contrast ratio?

Use at least 4.5:1 for normal text and 3:1 for large text. A ratio of 7:1 meets enhanced AAA for normal text.

What are tints and shades?

A tint mixes a color with white. A shade mixes it with black.

Can I use these values in CSS?

Yes. HEX, RGB and HSL values can be pasted directly into CSS color properties.

What's the difference between HEX, RGB and HSL?

They're three notations for the same color: HEX is compact (#E4572E), RGB lists the decimal channel values (228, 87, 46), and HSL describes hue, saturation, and lightness — which feels more intuitive when you're darkening or muting a color. Convert freely; the rendered color is identical.

Why do my brand colors look different on phones?

Screens differ in calibration, brightness, color gamut, and dark-mode handling. Test brand colors on several real devices, and favor slightly darker, more saturated versions — they survive display differences far better than pale pastels.

How many colors should a palette have?

Five is a practical maximum: one primary, one secondary, one accent, plus a dark and a light neutral. The neutrals do most of the heavy lifting in real interfaces; more than five colors and designs start looking noisy and unfocused.

What colors go with sage green?

Sage green (#9CAF88, RGB 156, 175, 136) pairs best with warm cream #FDF9F5, charcoal #36454F, terracotta #CC7357 and navy #1A2D5F. Use sage for backgrounds and large surfaces, cream for light areas, charcoal or near-black #1F2937 for text (that pair measures about 6.2:1, passing WCAG AA for normal text), and terracotta or navy only as accents. Do not put white text on sage: at about 2.4:1 it fails AA. Paste #9CAF88 into the picker above to generate its tints, shades and matching palette.

How do I pick website colors that pass WCAG contrast?

Start from your brand color, then darken it in HSL until it passes: blue #3B82F6 on white measures about 3.7:1, fine for large text and UI borders but short of the 4.5:1 AA bar for normal text, while its darker shade #2563EB measures about 5.2:1 and passes. Keep failing shades for decoration only (borders, icons, backgrounds without text), check links against both the background and the surrounding body text, and re-check every pair in dark mode. Use the contrast checker on this page to test each pair before you ship.

What colors go with navy blue?

Navy blue (#000080, RGB 0, 0, 128) pairs best with crisp white #FFFFFF, warm cream #FFF6E6, muted gold #D7B56D and coral-orange #FF6B35. Use navy for backgrounds and large surfaces, white or cream for light areas, and gold or coral only as accents: gold on navy measures about 8.2:1 and coral text on navy about 5.7:1, both passing WCAG AA for normal text, while navy text on white measures about 16.0:1 and on cream about 14.9:1. Never put gold text on white (about 2.0:1, a fail) and never pair navy with pure black, which blurs the boundary between the two dark shades. Paste #000080 into the picker above to read its RGB, HSL and CMYK values and test each pair in the contrast checker.

How do I choose an accent color for my website?

Pick one accent and give it one job: buttons, links and highlights only, about 10% of the page under the 60-30-10 rule (60% neutral background, 30% secondary surfaces and text, 10% accent). Start from your base color, then choose an accent that stands out against it without shouting everywhere: with a navy base #000080, coral-orange #FF6B35 works as a button background with navy text (about 5.7:1, passing AA), while the same coral as text on white fails at about 2.8:1, so the accent must sit on the dark base, not on white. Test every button-text pair in the contrast checker on this page, keep success green, warning amber and error red separate from the accent, and if everything looks like the accent, nothing stands out.

What colors go with teal?

Teal (#008080, RGB 0, 128, 128) pairs best with warm white #FFF8F0, cream #FFF6E6, coral-orange #FF6B35, terracotta #CC7357 and navy #000080, with muted gold #D7B56D or copper as small metallic accents. Use teal for large surfaces, warm white or cream for light areas, and coral or terracotta only as accents - never as text on teal: coral text on teal measures about 1.7:1 and gold text on teal about 2.4:1, both failing WCAG AA. White text on teal measures about 4.8:1 and passes AA, and teal text on warm white about 4.5:1, also a pass - but teal text on cream is about 4.4:1, just under the bar, so use a darker teal or larger text there. Navy and teal together work only as large blocks (about 3.4:1 as a text pair, large text only). Paste #008080 into the picker above to generate its tints, shades and matching palette, and check every pair in the contrast checker.

How do I pick a color palette for a logo?

Start in black and white: a logo must still read as a pure black mark on white (21:1) before any color is added, so the shape carries it, not the color. Then pick one primary color that matches the brand - one deep, trustworthy blue like #1E40AF for a serious brand, one energetic color for a playful one - and at most one accent plus black, white and a gray neutral; most strong logos use one primary plus black and white. Avoid very light primaries (they vanish on white) and neon colors (they shift across screens and print). Test the pair in the contrast checker on this page: white text on #1E40AF measures about 8.7:1, a clear AA pass, while amber #F59E0B works as a button or badge background with dark text #1F2937 at about 6.8:1 - but the same amber as text on white fails at about 2.2:1, so the accent must sit on the dark base, not on white. Check the palette at a small size, on a dark background and in print before you lock it in.

What colors go with burgundy?

Burgundy (#800020, RGB 128, 0, 32) pairs best with ivory #FFF8F0, warm cream #FFF6E6, blush #E8C4B8 and muted gold #C9A060, with forest green #354A1E, navy #000080 and mustard as darker partners. Burgundy is a strong, dark color, so it works best as the main color with light partners doing the reading: burgundy text on white measures about 10.8:1, on ivory about 10.3:1 and on warm cream about 10.1:1 - all AAA - and ivory text on burgundy is about 10.3:1, also AAA, while blush text on burgundy is about 6.7:1, a clear AA pass. Muted gold text on burgundy is about 4.48:1, just under the AA bar, so use gold as decoration, never as text; mustard is the same story, with #CC9933 at about 4.2:1 failing AA while a lighter mustard #D9A441 at about 4.8:1 passes. Forest green text on burgundy is about 1.1:1 and navy text on burgundy about 1.5:1, both failing - dark on dark never works as text, even when the two blocks look good side by side. Check the undertone first: burgundy leans brown or plum, and which way it leans decides what flatters it. Paste #800020 into the picker above to generate its tints, shades and matching palette, and check every pair in the contrast checker.

How do I choose colors for dark mode?

Do not just invert your light palette - swapping white for black leaves you with harsh, glaring text and brand colors that vibrate. Build the dark theme from its own rules instead. Start with a very dark gray base, #121212 to #1A1A1A, never pure black: pure white text on #121212 measures about 18.7:1, which passes but glares and haloes, so use off-white #E2E2E6 for primary text instead - about 14.5:1, still AAA - and #94A3B8 for secondary text, about 7.3:1. Show elevation with lighter surfaces, not shadows: base #121212, cards #1E1E1E, menus and dialogs #2C2C2C - the step from base to card is only about 1.1:1, subtle on purpose, because elevation in dark mode is felt, not shouted. Move each brand color with the HSL rule: keep the hue, reduce saturation by 10-20% and increase lightness by 15-25%. A blue like #2563EB measures only about 3.6:1 on #121212, failing AA for normal text, but lightened to #6B93F5 it is about 6.4:1, a pass, and #90CAF9 is about 10.7:1, AAA; a deep cobalt #0047AB is about 2.2:1 on #121212 and fails outright. Generate the lighter variants with the shades and tints tool on this page, then verify every pair in the contrast checker against the dark base - never trust a light-mode pass in dark mode.

What colors go with mustard yellow?

Mustard yellow (#CC9933, RGB 204, 153, 51) is a warm, darkened yellow, so use it as an accent or a background, never as body text on a light surface. Its classic partner is navy blue #000080: navy text on mustard measures about 6.23:1, passing WCAG AA for normal text, and mustard text on navy measures the same 6.23:1, so the pair works both ways as text. Black text on mustard is about 8.17:1, AAA, the safest text pairing of all. White text on mustard is only about 2.57:1 and mustard text on white the same 2.57:1, so mustard fails as text on any light background. Charcoal #36454F text on mustard is about 3.85:1, large text only. Burgundy text on mustard is about 4.22:1, just under the AA bar, so use burgundy as blocks beside mustard, not as text on it — on the lighter mustard #D9A441, burgundy text passes at about 4.82:1. Olive and terracotta look good as blocks next to mustard, but never as text on it: olive text on mustard is about 1.63:1 and terracotta text on mustard about 1.33:1. Other good partners are warm cream #FFF6E6, olive #808000 and terracotta #CC7357 as surfaces, not text. The clash rule from every guide is the same: cool pastels and bright primaries fight mustard, so keep them out. Paste #CC9933 into the picker above to generate its tints, shades and matching palette, and check every pair in the contrast checker before you ship it.

How do I find the hex code of a color on a website?

The fastest no-install way is your browser's own developer tools. In Chrome, right-click the element and choose Inspect, then in the Styles panel click the little colored square next to the color or background-color value: the picker that opens shows the hex, RGB and HSL at once. Click the eyedropper icon inside that picker and you can sample any pixel on the page, including images and gradients. Two traps: the Computed tab shows colors as rgb(), not hex — Shift-click the color swatch, or use the picker's format switcher, to see the same color as hex; and DevTools samples in sRGB only, so a very wide-gamut color is clipped to its nearest match. Firefox has the same tool built in: menu, More Tools, Eyedropper. If you would rather not open developer tools at all, take a screenshot of the website and upload it to the "Pick a color from an image" panel above, then click the exact pixel — the hex appears instantly and the screenshot never leaves your browser. Then paste the hex into the converter above to read its RGB, HSL and CMYK values, or into the contrast checker to test it as text before you use it.

What is the Pantone Color of the Year 2026 and its hex code?

Pantone named PANTONE 11-4201 Cloud Dancer its Color of the Year 2026 — the first white-family shade ever picked — announced on 4 December 2025. Pantone publishes no official sRGB value, so every hex is an approximation: most sources cite #F0EEE9 (RGB 240, 238, 233), while a few publish #F0EFEB, so expect tiny differences between tools. WGSN and Coloro picked the opposite direction, Transformative Teal (Coloro 092-37-14), screen equivalent about #0F5C63. Use Cloud Dancer as a background, never as text: on white it measures about 1.2:1, a fail. Transformative Teal text on Cloud Dancer measures about 6.6:1, passing WCAG AA, and white text on the teal is about 7.7:1, passing AAA. Paste either hex into the picker above to read its RGB, HSL and CMYK values.

What colors go with terracotta?

Terracotta (#E2725B, RGB 226, 114, 91) pairs best with warm cream #F3EDE0, sage green #9CAF88, deep navy #1F2A44, cobalt blue #0047AB and burgundy #6D3445. Note the hex itself varies by source — #C8643B and #B86A52 are the same color family, darker and browner — so paste your exact shade into the picker above before you trust any pairing. The rule that matters is the text rule: terracotta text on white measures only about 3.1:1, and even the darker #B86A52 reaches just 4.0:1, so terracotta fails WCAG AA as body text on any light background — use it as a background or accent block instead, with dark text on it or beside it. Navy text on cream is about 12.2:1, cobalt text on white about 8.4:1 and burgundy text on white about 9.4:1, all AAA, while sage text on white is only about 2.4:1, so sage belongs on the background side too. Check every pair in the contrast checker on this page before you ship it.

How HEX, RGB and contrast math work

Screens create color by mixing red, green, and blue light. HEX is simply RGB written in base-16: #RRGGBB, where each pair is one channel from 00 (off) to FF (255, full brightness). RGB lists the same three channels in decimal, and HSL describes the same color as hue/saturation/lightness — three notations, one color.

Conversion is base-16 arithmetic: split #E4572E into pairs E4, 57, 2E → R = 14×16 + 4 = 228, G = 5×16 + 7 = 87, B = 2×16 + 14 = 46 → rgb(228, 87, 46). Readability is measured by the contrast ratio: (L1 + 0.05) ÷ (L2 + 0.05), where L is relative luminance (0 for black, 1 for white). WCAG AA requires ≥ 4.5:1 for body text and ≥ 3:1 for large text.

Worked example: white text on #E4572E. L(white) = 1.0, L(#E4572E) ≈ 0.20 → ratio ≈ 1.05 ÷ 0.25 = 4.2:1. That passes AA for large text (needs 3:1) but fails for body text (needs 4.5:1) — so darken the background a notch or bold the text before shipping it.

Practical tips: a tint mixes a color with white, a shade mixes it with black — generate both for hover states and depth. Preview palettes in grayscale: if the design still reads, your value contrast is solid. Limitation: HEX can't express transparency — reach for rgba() or 8-digit HEX (#RRGGBBAA) when you need opacity.

The luminance math behind contrast ratios: relative luminance isn't a simple average — human eyes are most sensitive to green, so the formula weights channels: L = 0.2126×R + 0.7152×G + 0.0722×B, where each channel is first linearized from sRGB (values ≤ 0.04045 ÷ 12.92, else ((v+0.055)/1.055)^2.4). That's why pure blue (#0000FF, L≈0.07) looks far darker than pure green (#00FF00, L≈0.72) despite equal "brightness" in RGB numbers. For palette building, HSL is the practical tool: fix the hue, then step lightness in 10% increments to generate tints and shades that stay harmonious — far more intuitive than nudging RGB channels blindly. And when sampling colors from images, average a 5×5 pixel area rather than a single pixel; JPEG compression noise makes single-pixel samples lie, especially in gradients and shadows.

Copied

Last updated: 5 December 2026 · Reviewed by Furqan Ahmad · Free forever, no signup.