Home Design Tools HEX to RGB

HEX to RGB - With Contrast Checker & Eyedropper

Convert HEX to RGB, RGBA, HSL, and CMYK instantly. Check WCAG accessibility contrast, preview the color on real buttons and cards, pick a color directly from any image, and export ready-to-use code for CSS, Tailwind, Swift, or Android.

Always Free Eyedropper from image WCAG contrast checker Runs in browser
RGB · HSL · CMYK · CSS · Tailwind · Swift · Android
Pick any color directly from an uploaded image
WCAG contrast ratio checked automatically
Export to CSS, Tailwind, Swift, and Android instantly
#3B82F6 #22C55E #EF4444 #F59E0B #9333EA
Upload any image, then click on it to pick a color
WCAG Accessibility Contrast
Sample text
on white background
-
Sample text
on dark background
-
Live preview on real UI
Button
Text on white
Sample heading
Sample body text
Text on dark
Sample heading
Sample body text
Card accent
Card title
Supporting text goes here
Border / outline
Outlined box
Tag / badge
Status
Color variations - click any to convert it
Shades (darker)
Tints (lighter)
Harmonies
Closest matches
Color blindness simulation

Other converters give you
a number. This gives you a decision.

Accessibility built in, live preview on real UI, eyedropper from any image, and code-ready exports - not just a hex-to-rgb math conversion.

Eyedropper from any image

Upload a screenshot or photo and click any pixel to extract its exact color - instantly converted to every format. No other free converter does this.

click any pixel

WCAG contrast built in

Every color is automatically checked against white and black backgrounds for WCAG AA/AAA pass/fail - with a suggested fix if it fails.

accessibility, not an afterthought

Live preview on real UI

See your color as an actual button, card, badge, and border - not just a flat square. Know how it really looks before you ship it.

buttons, cards, badges

Code-ready exports

Copy your color as a CSS variable, Tailwind class, SwiftUI Color, or Android Color.parseColor() - the exact syntax for your stack.

7 export formats

Instant palette, not one color

Shades, tints, and harmony colors generated automatically - click any swatch to explore further instead of starting over.

exploration, not a dead end

Color blindness simulation

See your exact color as it appears under protanopia, deuteranopia, and tritanopia - make sure your palette works for everyone.

real accessibility check

Convert and check a color in seconds

1

Enter or pick a color

Type a HEX code, use the color picker, or upload an image and click a pixel with the eyedropper.

2

Check it works

Review the contrast ratio against white and dark backgrounds, and preview the color on real buttons and cards.

3

Export to your code

Copy the exact syntax for CSS, Tailwind, Swift, or Android - or explore shades and tints first.

HEX to RGB - the conversion and why it matters

A HEX color code like #3B82F6 represents a color using three pairs of hexadecimal digits - one each for red, green, and blue. Each pair ranges from 00 to FF in hexadecimal, which is 0 to 255 in decimal. So 3B becomes 59, 82 becomes 130, and F6 becomes 246 - giving rgb(59, 130, 246).

Why you'd use RGB instead of HEX

HEX is compact and common in design tools, but RGB (and RGBA) is often more useful in code when you need to manipulate individual channels or add transparency. CSS, JavaScript color libraries, and canvas drawing APIs frequently expect RGB or RGBA values directly. HSL is preferable when you want to adjust lightness or saturation predictably - increasing the L value in HSL reliably makes a color lighter, while no such simple adjustment exists in RGB or HEX.

Why contrast checking matters here. WCAG 2.1 requires a 4.5:1 contrast ratio for normal text to pass AA - the most commonly required accessibility standard, including for many government and enterprise contracts. A color that looks fine to you may fail for users with low vision. Converting a color is often the first step before using it as text or a background, so checking contrast at the same time saves a separate trip to a different tool.

Choosing accessible color combinations

The contrast ratio between two colors is calculated from their relative luminance - a weighted measure of how much light each color reflects, accounting for how the human eye perceives different wavelengths. A pure black-on-white combination has the maximum possible ratio of 21:1. Pastel colors on white backgrounds often fail contrast checks even though they look pleasant, because their luminance is too close to white's.

WCAG levelNormal textLarge text / UI
AA (standard)4.5:1 minimum3:1 minimum
AAA (enhanced)7:1 minimum4.5:1 minimum

Using the eyedropper for design handoff

A common real-world need: someone sends a screenshot or a competitor's website and asks "what color is that?" Instead of guessing or using a separate browser extension, upload the image directly here and click the exact pixel - the tool extracts the precise color and gives you every format you might need to actually use it.

Color conversion questions,
answered.

Ask a question
A HEX color like #3B82F6 splits into three pairs of hex digits: 3B, 82, and F6. Converting each pair from hexadecimal to decimal gives the RGB values: red 59, green 130, blue 246, written as rgb(59, 130, 246). This tool does the conversion instantly as you type.
WCAG AA requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text or UI components. WCAG AAA requires 7:1 for normal text and 4.5:1 for large text. This tool calculates the exact ratio and shows which levels your color passes.
Upload any image, then click anywhere on it to extract the exact color of that pixel. The color is instantly converted to HEX, RGB, HSL, and all other formats. This works entirely in your browser - the image is never uploaded to a server.
RGB defines a color using red, green, and blue values from 0 to 255. RGBA adds a fourth value, alpha, which controls transparency from 0 to 1. Use RGBA when you need a color to be semi-transparent.
Enter your HEX color and the tool automatically calculates the closest matching color in the default Tailwind CSS palette, showing you the class name like bg-blue-500.
Yes. The color blindness simulator shows how your chosen color would appear under protanopia, deuteranopia, or tritanopia - the three most common forms of color vision deficiency.