Convert colors between HEX, RGB, HSL, HSV, and CMYK formats with live preview.
Invalid color format. Try HEX (#FF5733), RGB (rgb(255,87,51)), or HSL (hsl(11,100%,60%)).
HEX
#FF5733
RGB
rgb(255, 87, 51)
HSL
hsl(11, 100%, 60%)
HSV/HSB
hsv(11, 80%, 100%)
CMYK
cmyk(0%, 66%, 80%, 0%)
CSS Variable
--color: #FF5733;
R255
G87
B51
Advertisement
About This Tool
Color conversion is a fundamental operation in digital design, web development, and print production. Different color models were developed to serve different purposes: HEX notation emerged alongside HTML in the early 1990s as a compact way to specify colors for the web, while RGB (Red, Green, Blue) directly represents how monitors and screens produce color by mixing light.
The HSL (Hue, Saturation, Lightness) and HSV (Hue, Saturation, Value) models, introduced by Alvy Ray Smith in 1978, were designed to be more intuitive for human color selection, organizing colors by perceptual qualities rather than hardware mechanics.
CMYK (Cyan, Magenta, Yellow, Key/Black) serves the print industry, describing colors in terms of ink absorption on paper. Unlike screen-based RGB which uses additive color mixing (combining light), CMYK uses subtractive color mixing (absorbing light). This fundamental difference means that not all RGB colors can be accurately reproduced in CMYK, a challenge known as gamut mapping.
This tool performs mathematically precise conversions between all five color models using standard algorithms defined by the W3C CSS Color Level 4 specification (https://www.w3.org/TR/css-color-4/). RGB serves as the intermediary color space: all inputs are first normalized to RGB, then converted to the target format.
HEX values are parsed as base-16 integers, HSL and HSV use trigonometric hue calculations based on min/max RGB components, and CMYK is derived using the standard undercolor removal formula. All processing runs entirely in your browser with no server communication, ensuring both speed and privacy.
Enter a color value in any format (HEX, RGB, HSL) or use the color picker.
View instant conversions to HEX, RGB, HSL, HSV, CMYK, and CSS variable format.
Use the RGB sliders to fine-tune the color, then copy any format with one click.
Color Theory & Digital Color Science
The science of digital color is rooted in discoveries spanning centuries. Isaac Newton's 1666 prism experiments first demonstrated that white light contains a spectrum of colors. In 1802, Thomas Young proposed the trichromatic theory, later refined by Hermann von Helmholtz, showing that the human eye perceives color through three types of cone cells sensitive to red, green, and blue wavelengths. This biological reality directly inspired the RGB color model used in all modern displays.
The CIE (Commission Internationale de l'Eclairage) established the first mathematical color space in 1931, creating a foundation for all digital color systems. The sRGB color space, standardized in 1996 by the IEC, became the default for web content and consumer displays. It defines a specific gamut, or range of representable colors, that all compliant devices must reproduce consistently.
Understanding color spaces is essential for anyone working across multiple media. The visible spectrum contains approximately 10 million distinguishable colors, but sRGB can represent only about 35% of them. Wider gamut spaces like Display P3 (used by Apple devices since 2016) and Adobe RGB (common in photography) cover more of the visible spectrum. CSS Color Level 4 introduced support for Display P3 via the color() function, signaling a shift toward wider gamut web design.
The relationship between color models is not always straightforward. Converting from a wider gamut to a narrower one requires gamut mapping, which can shift colors perceptibly. Similarly, the RGB-to-CMYK conversion is inherently lossy because the CMYK gamut is smaller and shaped differently than RGB. Professional color management uses ICC profiles, which contain lookup tables and mathematical descriptions of how specific devices reproduce color, enabling accurate cross-media color matching.
How to Use
Enter a color value in any format (HEX, RGB, HSL) or use the color picker.
View instant conversions to HEX, RGB, HSL, HSV, CMYK, and CSS variable format.
Use the RGB sliders to fine-tune the color, then copy any format with one click.
Methodology
All conversions use RGB as the intermediary color space. HEX values are parsed by extracting pairs of hexadecimal characters and converting each to a decimal integer (0-255). For HSL and HSV, the hue is calculated by finding the maximum and minimum RGB components, then applying sector-based formulas that map the color wheel into six 60-degree segments. Saturation and lightness/value are derived from the ratio and range of these components.
CMYK conversion uses the undercolor removal method: the Key (black) channel is calculated as K = 1 - max(R,G,B)/255, and each chromatic channel is derived by C = (1-R/255-K)/(1-K). This is a standard mathematical approximation; professional print workflows use ICC color profiles for precise color management. All formulas follow the W3C CSS Color Level 4 specification and produce results consistent with major design software including Adobe Photoshop, Figma, and Sketch.
Each color format serves a specific workflow and understanding when to use each one improves efficiency. HEX codes (#FF5733) are the standard for web development and CSS stylesheets because they are compact and universally supported by browsers. RGB values are ideal when working with screen-based media, as they directly map to how monitors emit red, green, and blue light.
HSL is the most designer-friendly format because adjusting lightness from 0% (black) through 50% (pure color) to 100% (white) is intuitive for creating color variations and themes. HSV/HSB is preferred in graphics software like Adobe Photoshop and Illustrator because its value channel represents the maximum brightness of a color, which aligns with how artists think about pigment strength.
CMYK values shown here are mathematical approximations suitable for initial design work, but professional print projects should use ICC color profiles and soft-proofing for accurate color reproduction.
Practical Examples
A web developer needs to match a client's brand color #1A73E8 (Google Blue) across their website and print brochure. They enter the HEX value and instantly get RGB(26,115,232) for CSS, HSL(217,80%,51%) for creating hover states by adjusting lightness, and CMYK(89%,50%,0%,9%) as a starting point for the print designer.
A UI designer creating a dark theme uses HSL to systematically darken their color palette. Starting from their primary color at HSL(220,65%,50%), they reduce lightness to 35% for the dark variant and increase to 80% for subtle backgrounds, maintaining consistent hue and saturation throughout.
An artist preparing digital artwork for both web gallery and giclée prints uses this tool to understand the CMYK gamut limitations of their vibrant RGB colors before sending files to the print shop.
Tips & Best Practices
When working with colors across different media, always start with RGB or HEX for screen work and convert to CMYK only when preparing files for print. Use HSL when you need to quickly create lighter or darker variations of a brand color, as you only need to adjust the lightness percentage while keeping hue and saturation constant.
For CSS development, consider using HSL notation in your stylesheets because it makes creating consistent color schemes much easier. You can define a base hue and then create complementary, analogous, or triadic colors by simply rotating the hue value by 180, 30, or 120 degrees respectively.
Always test your CMYK colors with a physical proof before committing to a print run, as screen displays can only approximate how ink will look on paper.
This tool supports HEX (#FF5733), RGB (rgb(255,87,51)), HSL (hsl(11,100%,60%)), HSV/HSB (hsv(11,80%,100%)), and CMYK. You can input any of these formats and get instant conversions to all others.
What's the difference between HSL and HSV?
HSL (Hue, Saturation, Lightness) and HSV (Hue, Saturation, Value/Brightness) are both cylindrical color models. The key difference is in how brightness is handled: HSL's Lightness goes from black (0%) through the pure color (50%) to white (100%), while HSV's Value only goes from black (0%) to the pure color (100%). HSL is often preferred for CSS, while HSV (also called HSB) is common in graphics software.
Why does CMYK look different on screen vs print?
Screens use RGB (additive color - light), while printers use CMYK (subtractive color - ink). The CMYK values shown here are approximations based on standard conversions. Actual printed colors depend on paper type, ink quality, and printer calibration. For accurate print colors, use professional color management software and calibrated equipment.
What is the difference between hex, RGB, and HSL?
All three represent the same colors but use different notation systems. Hex (#FF5733) is a compact way to write RGB values using hexadecimal — each pair of characters represents Red, Green, and Blue from 00 (0) to FF (255). RGB(255, 87, 51) expresses the same color using decimal numbers, which is more human-readable. HSL(14°, 100%, 60%) describes the same color using Hue (color angle on the color wheel), Saturation (color intensity), and Lightness (brightness). HSL is generally the most intuitive for design work because adjusting a single value changes one perceptual quality — for example, reducing saturation desaturates the color without changing its hue or brightness.
Why do my printed colors look different from my screen?
Screens use RGB (additive color mixing with light), while printers use CMYK (subtractive color mixing with ink). The RGB color space is larger than CMYK — it can display vivid blues, greens, and saturated colors that CMYK inks physically cannot reproduce. When converting from RGB to CMYK, out-of-gamut colors are clipped to the nearest printable equivalent, resulting in duller versions of bright screen colors. This is why a neon green that looks vibrant on screen prints as a muted olive. For print-critical work, design in CMYK mode from the start or use a color management workflow with ICC profiles to preview how colors will look in print.
What color formats should I use for web development?
For CSS, use hex (#FF5733) or RGB/RGBA (rgb(255, 87, 51)) for specific brand colors, and HSL/HSLA (hsl(14, 100%, 60%)) when you need to create color variations (lighter, darker, desaturated). HSL is particularly useful in design systems because you can generate a consistent color palette by varying only lightness or saturation. Modern CSS also supports the newer color functions like oklch() and lab() for perceptually uniform color manipulation, but browser support is still evolving. For accessibility, always check contrast ratios regardless of the format used — the format is just notation; the resulting color is what matters for readability.
My Favorites
Drag to reorder
No favorites yet
Tap the ☆ on any tool page to bookmark it for quick access.