Color Converter — HEX, RGB, HSL, HSV, CMYK, LAB & OKLCH | LazyTools

Free Color Converter — HEX, RGB, HSL, CMYK, LAB & OKLCH

Convert any color across HEX, RGB, HSL, HSV, CMYK, CIE LAB and OKLCH instantly. Visual color picker, exact and nearest CSS color name lookup, nearest web-safe and Tailwind palette colors, WCAG contrast checker, and one-click copy in 12+ developer formats (CSS variable, SCSS, Tailwind config, Swift UIColor, Android, Flutter). Free, no login.

HEX ↔ RGB ↔ HSL ↔ HSV ↔ CMYK ↔ LAB ↔ OKLCH WCAG contrast checker CSS name & Tailwind nearest 12+ copy formats Free, no login

Color Converter Tool

H 239°
S 84%
L 67%
HEX
RGB
HSL
HSV
CMYK
LAB
OKLCH
CSS var
SCSS
Swift
Android
Flutter
CSS Name
Tailwind nearest
Web-safe nearest
WCAG contrast
⭐ User Ratings

Rate this tool

4.9
Based on 56,240 ratings
5
50,616
4
3,937
3
1,124
2
281
1
281
Was this color converter helpful?
✅ Thank you for your rating!
✦ Features

Everything you need for color conversion in one tool

Most free color converters online do exactly one thing — convert HEX to RGB and back. Color Lab combines every conversion you actually need (including CIE LAB and OKLCH, which most free tools skip), plus colour analysis features that normally require a paid design tool. Every option below is free with no signup or premium tier.

7-format bidirectional conversion
HEX, RGB, HSL, HSV, CMYK, CIE LAB and OKLCH — all updated simultaneously as you type in any field. Type a HEX code and watch the LAB and OKLCH values update; tweak the HSL sliders and watch HEX update in real time. No "conversion" button to click.
Visual color picker + HSL sliders
Native browser color picker for instant visual selection, plus dedicated H, S and L sliders so you can dial in exact hue, saturation and lightness without losing the visual feedback. The slider tracks render in the actual color so you see the gradient as you move.
CSS color name lookup
Both directions: type a CSS color name like "tomato" or "cornflowerblue" and get the HEX, or type any HEX and see the exact CSS name (if there is one) plus the nearest named CSS color. Built-in dataset of all 147 CSS Level 4 named colors.
CIE LAB & OKLCH support
CIE LAB is the perceptually uniform color space used in print color matching and Delta E calculations — and it's missing from every other free converter. OKLCH is the modern CSS Color 4 standard for design systems with consistent perceived brightness across hues.
WCAG contrast checker
Live contrast ratio for your selected color against pure white and pure black, with AA and AAA pass/fail badges for both normal and large text. Catch accessibility issues the moment you pick a color, before the design ever reaches production.
Web-safe + Tailwind nearest
Find the closest match in the 216-color web-safe palette (rare requirement these days, but still needed for legacy compatibility) and the closest Tailwind CSS palette color (slate-500, indigo-600, emerald-400…) so you can map any HEX onto your design system.
12+ developer copy formats
Copy in any format with one click: HEX, RGB, HSL, HSV, CMYK, LAB, OKLCH, CSS variable, SCSS variable, Swift UIColor, Android color int (0xAARRGGBB) and Flutter Color. Stop hand-typing color values into your code.
Pantone-style approximation
Approximate Pantone Solid Coated match from a built-in dataset of widely-published popular swatches, useful as a starting point for print work. (For production printing, always verify against an official Pantone guide — the matches here are approximate.)
100% private — runs in your browser
All conversion happens locally in your browser. No colors are sent to any server, no tracking, no signup. Recent colors are saved to your browser's local storage so they survive a tab reload but never leave your device.
📖 How to use

How to use the color converter

Enter your color in any format
Three ways to start: type or paste a HEX code into the HEX field (with or without the # prefix), click the visual color picker to open your browser's native color wheel, or drag the H, S and L sliders to dial in a hue manually. Color Lab also accepts named CSS colors — type "tomato" or "cornflowerblue" into the HEX field and it will recognise them.
Read the conversion in every format
The right panel shows your color in twelve different formats simultaneously: HEX, RGB, HSL, HSV, CMYK, CIE LAB, OKLCH, plus pre-formatted snippets for CSS variable, SCSS, Swift UIColor, Android color int and Flutter Color. Every value updates the moment you change the input.
Check the analysis bar at the bottom
Below the conversion table, the analysis bar shows the exact CSS color name (if your color matches one) and the nearest named CSS color, the nearest Tailwind palette color, the nearest 216-color web-safe color, and your current color's WCAG contrast ratio against white and black with AA and AAA pass/fail badges.
Copy the format you need
Click the copy button next to any format to put it on your clipboard. Working in CSS? Grab the HEX or the CSS variable. Working in iOS? Grab the Swift UIColor. Working in Flutter or Android? Grab the Color or color int. The CMYK value is ready for your print designer; the LAB value is ready for color matching software.
Build a full palette from this color
Once you've found your base color, click the "Build a palette" button to open it in the Color Palette Generator with the current color pre-loaded. From there you can generate complementary, triadic, analogous, split-complementary and tetradic schemes, plus shade/tint ramps and Tailwind config exports.
⚖️ How we compare

Color Lab vs other free color converters

We benchmarked Color Lab against the most popular free color converters online — rapidtables.com, colorhexa.com, w3schools color picker, hexcolortool.com and Adobe Color's free tier. Here's the feature-by-feature breakdown.

Feature LazyTools rapidtables colorhexa w3schools Adobe Color
HEX ↔ RGB conversion
HEX ↔ HSL conversion
HEX ↔ CMYK conversionpaid
CIE LAB conversionpaid
OKLCH (CSS Color 4)
Visual color picker + sliders
CSS color name lookup
Nearest Tailwind color
Nearest web-safe color
WCAG contrast checker built inseparate
Swift / Android / Flutter export
One-click copy in 12+ formatsbasicbasicbasic
No login / no signup

Where Color Lab wins: the only free converter with OKLCH (CSS Color 4) support, the only one with nearest Tailwind palette matching, the only free converter with native Swift / Android / Flutter export formats, and the only one that bundles the WCAG contrast checker into the same page as the converter without forcing you to a separate tool. Where competitors win: colorhexa has the deepest reference content for any individual color (variations, tones, gradients, spectral analysis), and Adobe Color is unmatched for advanced color theory and palette extraction from images — but both either require login or paywall the most useful features.

🎨 Quick reference

Most-used CSS named colors

The CSS Color Module Level 4 specification defines 147 named colors that can be used directly in CSS without a HEX or RGB value. Here are the most frequently used ones, with their HEX equivalents. Click any row in the converter and search by name to use it.

Name HEX RGB Use case
black#000000rgb(0, 0, 0)Pure black, body text default
white#FFFFFFrgb(255, 255, 255)Pure white, default page background
red#FF0000rgb(255, 0, 0)Pure red, error states
lime#00FF00rgb(0, 255, 0)Pure green (RGB), debug highlights
blue#0000FFrgb(0, 0, 255)Pure blue, default link color
tomato#FF6347rgb(255, 99, 71)Warm CTA / accent
cornflowerblue#6495EDrgb(100, 149, 237)Soft brand blue
seagreen#2E8B57rgb(46, 139, 87)Success states
gold#FFD700rgb(255, 215, 0)Premium / pro tier
gray#808080rgb(128, 128, 128)Neutral text, borders
whitesmoke#F5F5F5rgb(245, 245, 245)Subtle background
indigo#4B0082rgb(75, 0, 130)Deep brand violet
📖 Complete guide

Color Spaces, Conversions and Why HEX Isn't Enough

Color on the web looks deceptively simple. You pick a HEX code, paste it into your CSS, and the browser draws the color. End of story — except it isn't, because the moment you have to do anything beyond display a single color on a single screen, you run into the messy reality of color spaces. Print designers want CMYK. Photographers want CIE LAB. Modern web designers want OKLCH for design systems with consistent perceived brightness. Accessibility auditors want WCAG contrast ratios computed from linear RGB. Mobile developers need UIColor literals or color int constants. This guide walks through every color space the Color Lab converter supports, explains when each one matters, and shows how the conversions actually work under the hood — so you understand what your tools are doing instead of just trusting them.

HEX — the format you already know

HEX is just a compact way of writing three (or four) bytes. The string #FF6B35 packs three numbers — 255, 107 and 53 — into six hexadecimal characters that are easy to copy, paste and read at a glance. The # is a sentinel that says "what follows is a color code." The first pair (FF = 255) is the red channel, the second pair (6B = 107) is the green channel, the third pair (35 = 53) is the blue channel. Each channel ranges from 0 to 255 because 8 bits can hold 256 distinct values. You can also write HEX in the short form #F63, which is shorthand for #FF6633 — each character is doubled. Modern CSS adds an optional alpha channel: #FF6B3580 means the same color at 50% opacity (80 in hex is 128, which is 128/255 ≈ 50%).

HEX is the universal interchange format for the web because it's compact and unambiguous. But HEX is just a representation of RGB — there is no "HEX color space," only an RGB color space written in hexadecimal. Every property HEX has is really a property of RGB.

RGB — additive light, screen-native

RGB stands for Red, Green, Blue. It's an additive color model, meaning colors are produced by adding light together: starting from black (no light) and adding red light, green light and blue light in different amounts. Maximum red plus maximum green plus maximum blue produces white, because all the wavelengths combine. RGB is the native color model for anything that emits light: monitors, phones, TVs, projectors, LED signs.

Each channel is conventionally represented as an integer from 0 to 255 (8 bits per channel, 24-bit color in total, also called "true color"). Modern displays support 10 bits per channel (HDR / Display P3) but the CSS standard still uses 0–255. RGB also has a normalised form where each channel runs from 0.0 to 1.0, which is what graphics libraries and shaders use internally. The Color Lab converter outputs both: the integer form for CSS and the float form for the Swift UIColor literal.

HSL and HSV — perceptually-friendlier color models

RGB is great for hardware but terrible for humans. If I tell you "rgb(178, 34, 200)," you have no immediate intuition for what that color looks like or how to make it slightly bluer or slightly darker. HSL and HSV solve this by describing colors using axes that match how people actually think about color: hue ("what color is it?"), saturation ("how vivid is it?") and lightness or value ("how bright is it?").

HSL uses Hue (0–360°), Saturation (0–100%) and Lightness (0–100%). Lightness is symmetric — 0% is pure black, 50% is the pure hue, 100% is pure white. So an HSL hue at 50% lightness is "the color," and you can move toward white or black by sliding lightness up or down. HSV uses Hue, Saturation and Value, where Value is asymmetric — 0% is pure black, 100% is the brightest version of the hue with no white added at all. To get white in HSV you have to drop saturation to 0 and raise value to 100. HSL is more intuitive for picking colors visually; HSV is more common in image editors because the value slider matches how monitors display brightness directly.

HSL conversion to and from RGB is a deterministic mathematical operation — no information is lost in either direction, and round-tripping HEX → HSL → HEX gives you the same value back (modulo rounding to integer percentages). The Color Lab converter does the round trip continuously as you drag the sliders.

CMYK — subtractive color for print

CMYK is the four-channel color model used in commercial printing: Cyan, Magenta, Yellow and Key (which is black, called "key" historically because it's the printing plate that aligns with the others). It's a subtractive model — colors are produced by laying inks on white paper, and each ink absorbs (subtracts) part of the spectrum from the reflected light. Maximum cyan plus maximum magenta plus maximum yellow theoretically produces black, but in practice the result is a muddy brown, which is why a separate black ink is added. CMYK uses percentages (0–100%) for each channel.

The conversion from RGB to CMYK is a standard mathematical formula, but here's the part most online converters don't tell you: the standard conversion is an approximation. Real-world print color depends on the specific ink set, paper stock, ink absorption rate, registration accuracy and the press's color management profile. Two printers handed the same CMYK file will produce subtly different colors. For production print work, the CMYK values from any free online converter (including this one) are a starting point — your print shop will make adjustments based on their specific workflow. For comps, mockups, specs and design discussions, the calculated CMYK is fine.

CIE LAB — perceptually uniform, the gold standard

CIE LAB (also written CIELAB or L*a*b*) was designed by the International Commission on Illumination in 1976 as a perceptually uniform color space. The defining property of LAB is that equal numerical distances correspond to equal perceived differences — if two colors are 5 units apart in LAB, they look about as different from each other as any other pair of colors that are 5 units apart. RGB doesn't have this property at all (a 10-unit change in the green channel is much more visible than a 10-unit change in the blue channel because human vision is most sensitive to green light). HSL doesn't have it either.

LAB uses three axes: L* for lightness from 0 (black) to 100 (white), a* for the green-red axis (negative is green, positive is red, no fixed range but typically -128 to +127), and b* for the blue-yellow axis (negative is blue, positive is yellow, same range). The conversion from sRGB to LAB goes through several intermediate spaces: first sRGB is converted to linear RGB by undoing the gamma curve, then to CIE XYZ using a 3×3 matrix transform with the D65 illuminant white point, then to LAB using a non-linear function with a cube-root transform. The Color Lab converter does all of this in JavaScript on the client.

Why does LAB matter? Two main reasons. First, color matching: when you need to know if two colors look the same to a human observer (rather than whether they have the same RGB numbers), you compute the Euclidean distance in LAB space — this is called Delta E, and it's the standard metric for color difference in print, photography, paint matching and textile dyeing. Second, perceptual operations: if you want to lighten a color "by 10%" in a way that looks consistent across hues, you do it in LAB space, not RGB. LAB is the color space all professional color management is built on.

OKLCH — modern CSS, better than HSL

OKLCH is a 2020 color space designed by Björn Ottosson, now natively supported in CSS Color Module Level 4. It expresses colors using L (perceptual lightness, 0 to 1 or 0% to 100%), C (chroma, similar to saturation but unbounded — typically 0 to about 0.4 for sRGB colors), and H (hue from 0° to 360°). OKLCH solves a long-standing problem with HSL that you've probably noticed without naming: in HSL, two colors with the same lightness value can look noticeably different in perceived brightness. A yellow at 50% HSL lightness looks much brighter than a blue at 50% HSL lightness because human vision is more sensitive to yellow wavelengths. This makes HSL nearly useless for design systems where you want predictable contrast across hues.

OKLCH uses perceptual lightness instead, the same concept as LAB's L* axis, so a 50% L OKLCH yellow and a 50% L OKLCH blue look about equally bright. The chroma axis is unbounded but in practice tops out around 0.37 for the brightest sRGB colors. The hue axis is the standard 0–360° wheel. OKLCH is the right format for modern CSS design tokens, color palettes that scale predictably across light and dark themes, and any project where you want consistent visual weight across colors. Browsers including Chrome, Safari, Firefox and Edge all support oklch() in CSS as of late 2023 and it's increasingly common in production design systems.

Web-safe colors and Tailwind palette nearest

The "web-safe palette" is a set of 216 colors (6 × 6 × 6 levels of red, green and blue, where each channel is restricted to 00, 33, 66, 99, CC or FF in hex). It was created in the 1990s when 256-color displays were common and any color outside the safe palette would be dithered into a noisy approximation. Modern displays handle 16.7 million colors easily, so the web-safe palette is essentially obsolete — but the Color Lab converter still computes the nearest web-safe color because it's occasionally needed for legacy embedded displays, e-ink screens, very low-bit-depth output and retro design projects.

Far more useful for modern work is the Tailwind palette nearest match. Tailwind CSS ships with a carefully-designed palette of about 220 colors (22 hue families × 10 lightness steps each, from 50 to 950). When you pick a color in any tool and want to know which Tailwind utility class produces the closest match, the converter computes the perceptual distance in LAB space against every color in the Tailwind palette and tells you the nearest one. So you can sample a color from a logo, find out it's closest to indigo-500, and use that class directly in your code.

WCAG contrast and accessibility

The Web Content Accessibility Guidelines (WCAG) define a specific formula for measuring how visually distinguishable two colors are when one is placed on top of the other. The formula computes the relative luminance of each color (a weighted sum of the gamma-corrected RGB channels: 0.2126 × R + 0.7152 × G + 0.0722 × B, after undoing the sRGB gamma curve), then divides the brighter luminance plus 0.05 by the darker luminance plus 0.05. The result is a contrast ratio between 1:1 (no contrast, the same color on itself) and 21:1 (maximum contrast, pure black on pure white).

WCAG defines four pass thresholds: AA normal text requires at least 4.5:1, AA large text (18pt+ or 14pt+ bold) requires 3:1, AAA normal text requires 7:1, and AAA large text requires 4.5:1. The Color Lab analysis bar shows your selected color's contrast ratio against pure white and pure black with pass/fail badges for each threshold, so you can immediately tell whether a color works as a foreground on a white page or a background under black text. Catching contrast failures at the color-picking stage is much faster than running a full accessibility audit after the design is built.

Pantone — the part where we have to be honest

Pantone is a proprietary color matching system used in commercial printing, fashion and product design. The Pantone company sells physical swatch books (the "Solid Coated" book is the standard reference) and licenses their color codes to software vendors. The accurate sRGB or LAB equivalents of Pantone colors are licensed commercial data, not freely available, which is why you almost never see Pantone matches in free online tools — and when you do, they're approximations, not certified equivalents.

The Color Lab converter includes a small dataset of widely-published popular Pantone-style approximations so you can get a rough nearest match for a HEX color. This is useful as a starting point for ballpark conversions ("which Pantone is roughly this brand color?") but it is not accurate enough for production print work. For any project where Pantone color reproduction matters legally or commercially, use an official Pantone Color Bridge guide, your print shop's certified color management workflow, or licensed software with the official Pantone library.

From a single color to a full palette

This converter is focused on doing one color really well — every conversion, every analysis, every export format for one selected color. If your task is the next step ("now build a complete palette around this base color"), the right tool is the LazyTools Color Palette Generator. It takes any base color and generates harmonious palettes — complementary, triadic, analogous, split-complementary and tetradic — with shade and tint ramps for each color, contrast checks across every pair, and export to CSS variables, Tailwind config, SCSS or Figma styles. The palette generator uses the same color math as Color Lab, so the colors you pick here roundtrip cleanly into a full design system.

Frequently asked questions

Type or paste your HEX code (with or without the # prefix) into the HEX field in the converter. The RGB value updates instantly as you type. The conversion takes the two-digit hexadecimal pairs that follow the # and converts each one to a decimal number from 0 to 255: the first pair becomes the red channel, the second the green channel, and the third the blue channel. So #FF6B35 becomes R=255, G=107, B=53. The converter also accepts the short three-character form #FFF, which is automatically expanded to #FFFFFF.
Type your R, G and B values (each from 0 to 255) into the RGB fields and the HEX value will update instantly. To convert manually, take each channel value, convert it to two-digit hexadecimal (so 255 becomes FF, 107 becomes 6B, 53 becomes 35) and concatenate them with a # prefix. R=255, G=107, B=53 becomes #FF6B35. The Color Lab converter handles this automatically and also gives you HSL, HSV, CMYK, LAB and OKLCH equivalents at the same time.
HSL and HSV are both cylindrical color models that describe colors using Hue (the position on the color wheel from 0° to 360°), Saturation (how vivid the color is) and a third axis. In HSL the third axis is Lightness, where 0% is pure black, 50% is the pure hue, and 100% is pure white. In HSV the third axis is Value (also called Brightness), where 0% is pure black and 100% is the brightest version of the hue with no white added. HSL is more intuitive for designers because moving the lightness slider from a hue to white feels symmetrical with moving it to black. HSV is more common in image editors and color pickers because the value slider matches how monitors physically display brightness.
CMYK stands for Cyan, Magenta, Yellow and Key (black) and is the four-channel color model used in commercial printing. Each channel is a percentage from 0 to 100 representing how much ink of that color is laid down on the page. CMYK is subtractive — adding inks together makes the result darker — which is the opposite of the additive RGB model used by screens, where adding light together makes the result brighter. Use CMYK for any artwork that will be physically printed: business cards, flyers, brochures, posters, packaging. Use RGB or HEX for anything that will be displayed on a screen. Be aware that the CMYK conversion in any free online tool, including this one, is a mathematical approximation — the real CMYK values your printer uses depend on their specific ink set, paper stock and printing process, so always check with your print shop for production work.
CIE LAB (also written as CIELAB or L*a*b*) is a color space defined by the International Commission on Illumination in 1976. It expresses any color using three values: L* for perceptual lightness from 0 (black) to 100 (white), a* for the green-red axis (negative is green, positive is red), and b* for the blue-yellow axis (negative is blue, positive is yellow). The defining feature of CIE LAB is perceptual uniformity — equal numerical distances between two colors in LAB space correspond approximately to equal perceived differences to the human eye, which is not true of RGB or HEX. This makes LAB the standard color space for color matching, color difference calculations (Delta E), professional photo editing, color management profiles, and any task where you need to know whether two colors look the same to a human observer rather than just whether they have the same RGB numbers.
OKLCH is a modern color space designed by Björn Ottosson in 2020 that is now natively supported in CSS. It expresses colors using L (perceptual lightness, similar to LAB but with improved hue uniformity), C (chroma, which is similar to saturation) and H (hue from 0 to 360 degrees). OKLCH solves a long-standing problem with HSL: in HSL, two colors with the same lightness value can look noticeably different in brightness (a yellow at 50% lightness looks much brighter than a blue at 50% lightness). OKLCH uses perceptual lightness instead, so a 50% L yellow and a 50% L blue look equally bright. This makes OKLCH the right choice for design systems where you want consistent contrast across hues, color palettes that scale predictably, and any modern web project that uses CSS Color Module Level 4 features.
The Web Content Accessibility Guidelines (WCAG) define a contrast ratio formula that measures how distinguishable two colors are when one is placed on top of the other. The formula calculates the relative luminance of each color (a weighted sum of the linear-light RGB channels) and divides the brighter by the darker, plus an offset. The result is a ratio from 1:1 (no contrast) to 21:1 (maximum contrast, black on white). WCAG AA requires at least 4.5:1 for normal body 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. The Color Lab converter shows your selected color's contrast ratio against pure white and pure black so you can immediately see whether it passes AA or AAA for foreground or background use.
No — they are approximate matches from a built-in dataset of popular Pantone Solid Coated colors and should be treated as a starting point only, not as a substitute for an actual Pantone swatch book. Pantone is a proprietary trademarked color matching system and the official sRGB or LAB equivalents of Pantone colors are licensed commercial data. The Color Lab converter uses a small open dataset of widely-published Pantone-style approximations to give you a rough nearest match, which is useful for ballpark conversions but is not accurate enough for production printing. For any work that requires guaranteed Pantone color reproduction, use an official Pantone Color Bridge guide or your print shop's certified color management workflow.
🔗 Related tools

More free color & design tools