KitQuarter

Color Converter

Paste any color code, or pick a color, and see it in HEX, RGB, HSL, HSV, and CMYK instantly. Copy any row with one click. Free, no sign-up, and everything runs in your browser.

Enter 3, 4, 6, or 8 hex digits, like #FF6347 or #F57.

How the math works. HEX pairs are base 16, so FF means 255. RGB to HSL divides each channel by 255, then uses the largest and smallest channels to find lightness, saturation, and hue. RGB to CMYK takes K as 1 minus the largest channel, then divides the rest by what is left. The CMYK numbers are the plain math conversion, so treat them as an approximation for print work rather than a finished print file.

James Carter, Math and Tools Editor
Reviewed by James Carter, Math and Tools Editor · 119 calculator guides
Formulas verified against standard references. Calculator logic tested with verified worked examples. Published: November 4, 2026 | Last updated: November 4, 2026. Our methodology

Color Formats at a Glance

Every color on a screen or a printed page can be written in several formats, and each format suits a different job. The table below shows the five formats this color converter handles, with the same worked color in each row. That color is tomato, and you will see it carried through every section of this page.

FormatValue rangesUsed forTomato example
HEX#RRGGBB, each pair 00 to FFWeb and CSS, design handoff#FF6347
RGBThree channels, 0 to 255 eachScreens, CSS, JavaScriptrgb(255, 99, 71)
HSLHue 0 to 360, saturation 0 to 100%, lightness 0 to 100%CSS, design tokenshsl(9, 100%, 64%)
HSVHue 0 to 360, saturation 0 to 100%, value 0 to 100%Photoshop, Figma, and Illustrator pickershsv(9, 72%, 100%)
CMYKFour inks, 0 to 100% eachPrintcmyk(0%, 61%, 72%, 0%)
CSS name148 keywordsQuick prototypingtomato

HEX is the compact way to write RGB for the web, HSL describes the same color by hue and lightness for easier tweaking, HSV is what most design pickers show, and CMYK describes ink on paper for print. The converter above turns any one of these into all the others in one step.

Tomato #FF6347 shown as a 3D cube and sphere with its HEX, RGB, HSL, and CMYK values labeled
Tomato in HEX, RGB, HSL, and CMYK side by side.

How to Convert Between Color Formats

Every conversion below runs on the same worked color, tomato, so you can follow one color end to end. Each conversion is computed, not estimated, and the formulas are the standard ones used across the web and print industries.

HEX to RGB

Split the HEX code into three pairs and read each pair as a base 16 number, where each digit is worth its face value times 16 plus the second digit. For #FF6347, FF is 15 x 16 + 15 = 255, 63 is 6 x 16 + 3 = 99, and 47 is 4 x 16 + 7 = 71. That gives rgb(255, 99, 71). Readers who work with raw hex digits can also use our hex converter for general base-16 conversion.

RGB to HEX

RGB to HEX is the same arithmetic in reverse. Divide each 0 to 255 channel into two hex digits. For tomato, 255 becomes FF, 99 becomes 63, and 71 becomes 47, which reassembles as #FF6347.

RGB to HSL

First normalize each channel by 255. For tomato that is r = 1.000, g = 0.388, b = 0.278. Take the largest value, 1.000, and the smallest, 0.278. Lightness is their average, L = (1.000 + 0.278) / 2 = 0.639, which is 64%. Saturation is the spread divided by (2 - max - min) when lightness is above 50%, so S = 0.722 / 0.722 = 1.000, which is 100%. Because the largest channel is red, hue is H = 60 x ((0.388 - 0.278) / 0.722) = 60 x 0.152 = 9.1 degrees, rounded to 9. The result is hsl(9, 100%, 64%).

Three step diagram converting RGB 255, 99, 71 to HSL 9 degrees, 100 percent, 64 percent
The three steps from RGB(255, 99, 71) to HSL(9, 100%, 64%).

HSL to RGB

The chroma method walks the math back. With H = 9, S = 1.00, L = 0.64, chroma C = (1 - |2 x 0.64 - 1|) x 1.00 = 0.72. Then X = 0.72 x (1 - |(9 / 60) mod 2 - 1|) = 0.108, and m = 0.64 - 0.36 = 0.28. A hue of 9 degrees falls in the 0 to 60 sector, so the channels are (C, X, 0). Adding m and multiplying by 255 gives R = 255, G = 99, and B = 71. The round trip lands exactly back on rgb(255, 99, 71).

RGB to CMYK

Find the black channel first. K = 1 - the largest normalized channel = 1 - 1.000 = 0. Then each ink is (1 - channel - K) / (1 - K). For tomato, C = 0%, M = (1 - 0.388) = 0.612, which is 61%, and Y = (1 - 0.278) = 0.722, which is 72%. The result is cmyk(0%, 61%, 72%, 0%).

CMYK to RGB

Each channel is 255 x (1 - ink) x (1 - K), with the inks as fractions. For tomato, R = 255 x 1 x 1 = 255, G = 255 x (1 - 0.61) = 99.45, which rounds to 99, and B = 255 x (1 - 0.72) = 71.4, which rounds to 71.

RGB to HSV

HSV shares the hue with HSL but replaces lightness with value, which is simply the largest channel. The spread is 1.000 - 0.278 = 0.722, so saturation is 0.722 / 1.000 = 72% and value is 100%. Hue uses the same 9.1 degrees as the HSL math, giving hsv(9, 72%, 100%).

Which Color Format Should You Use?

Pick the format that matches the tool in front of you, not the one that looks shortest. The right choice saves you a conversion every time you edit the color.

What you are doingBest formatWhy
Writing web CSSHEX or HSLHEX is compact, and HSL makes lightness tweaks readable
Changing colors in JavaScriptRGB or HSLBoth map directly to CSS color functions
Sharing design tokens with a teamHSLHue stays fixed while shades are made by changing lightness
Matching a Photoshop or Figma pickerHSVThat is the color model those pickers display
Sending artwork to a print shopCMYKPrinters mix ink, not light, but confirm with their ICC profile

Transparency: Alpha in Every Format

Every format above can carry transparency, but each one writes it differently. In HEX, transparency is two extra digits at the end, from 00 for fully transparent to FF for fully opaque. Tomato at half opacity is #FF634780, because 80 in hex is 128 out of 255, which is 50%. In CSS, the rgb() and hsl() functions take a fourth value from 0 to 1 instead, so half-transparent tomato is rgba(255, 99, 71, 0.5).

Shorthand HEX follows one simple rule. Three digits double into six, so #F57 becomes #FF5577, and four digits double into eight, so #F57A becomes #FF5577AA. The shorthand is only valid when both digits of each pair match, which is why #FF6347 has no shorthand form. This color converter accepts 3, 4, 6, and 8 digit HEX and reports the alpha separately.

A Note on CMYK and Printing

The CMYK numbers on this page come from the plain mathematical conversion, and that is an approximation, not a print-ready result. Real print conversion depends on the paper, the press, and an ICC color profile that describes how that specific combination behaves. The same CMYK values can look noticeably different on coated and uncoated paper.

Screens and printers also cover different ranges of color. Screens mix red, green, and blue light and can show vivid oranges and greens that CMYK inks cannot reproduce exactly, so some colors shift when they move from screen to print. If color accuracy matters for your job, do the final conversion in Illustrator or InDesign with the print shop's profile. UXPICKLE's color converter guide gives the same advice and explains how design tokens fit into the workflow.

Common Colors in Every Format

Sixteen everyday colors with every format verified by the conversion formulas. Use this table as a quick reference when you need a known color in the format your tool expects.

ColorHEXRGBHSLCMYK
White#FFFFFF255, 255, 2550, 0%, 100%0%, 0%, 0%, 0%
Black#0000000, 0, 00, 0%, 0%0%, 0%, 0%, 100%
Red#FF0000255, 0, 00, 100%, 50%0%, 100%, 100%, 0%
Lime#00FF000, 255, 0120, 100%, 50%100%, 0%, 100%, 0%
Blue#0000FF0, 0, 255240, 100%, 50%100%, 100%, 0%, 0%
Yellow#FFFF00255, 255, 060, 100%, 50%0%, 0%, 100%, 0%
Cyan#00FFFF0, 255, 255180, 100%, 50%100%, 0%, 0%, 0%
Magenta#FF00FF255, 0, 255300, 100%, 50%0%, 100%, 0%, 0%
Silver#C0C0C0192, 192, 1920, 0%, 75%0%, 0%, 0%, 25%
Gray#808080128, 128, 1280, 0%, 50%0%, 0%, 0%, 50%
Maroon#800000128, 0, 00, 100%, 25%0%, 100%, 100%, 50%
Olive#808000128, 128, 060, 100%, 25%0%, 0%, 100%, 50%
Green#0080000, 128, 0120, 100%, 25%100%, 0%, 100%, 50%
Purple#800080128, 0, 128300, 100%, 25%0%, 100%, 0%, 50%
Teal#0080800, 128, 128180, 100%, 25%100%, 0%, 0%, 50%
Navy#0000800, 0, 128240, 100%, 25%100%, 100%, 0%, 50%

Check Contrast Before You Ship

A converted color is only half the job. Text on top of it has to stay readable, and the WCAG standard measures that with a contrast ratio. Normal text needs at least 4.5 to 1 to pass AA, and 7 to 1 to pass AAA.

On tomato, white text scores 2.95 to 1, which fails AA, so white buttons on a tomato background are hard to read. Black text on the same color scores 7.13 to 1, which passes AA and AAA. When you pick a brand color with this converter, convert it, then test your text color against it the same way before the design ships.

Labeled hue wheel showing hue degrees from 0 to 360, with red at 0, green at 120, and blue at 240
The hue wheel. Hue runs 0 to 360 degrees, so tomato at 9 degrees sits just past red.

Frequently asked questions

How do I convert HEX to RGB?

Split the HEX code into three pairs and read each pair as a base 16 number. For #FF6347, FF is 15 times 16 plus 15, which is 255, 63 is 99, and 47 is 71, giving rgb(255, 99, 71). The converter above does this instantly for any code you paste.

What is the difference between HSL and HSV?

Both use the same 0 to 360 hue, but the third value differs. HSL measures lightness from black to white and is native to CSS, while HSV measures value or brightness and is what Photoshop, Figma, and Illustrator pickers show. Tomato is hsl(9, 100%, 64%) but hsv(9, 72%, 100%).

Is the CMYK conversion accurate for printing?

It is a mathematical approximation, good for estimates but not for final print files. Real print conversion needs an ICC profile for the specific paper and press, which you set in Illustrator or InDesign. Always confirm the final mix with your print shop.

How do I add transparency to a HEX color?

Add two digits at the end for the alpha channel, from 00 for transparent to FF for opaque. Tomato at half opacity is #FF634780. In CSS you can also write rgba(255, 99, 71, 0.5).

What is the shorthand HEX format?

Three digits that double into six, so #F57 becomes #FF5577. It only works when both digits of each pair match, which is why #FF6347 has no shorthand form.

Why do two converters show slightly different values?

Rounding. One tool may show lightness as 64% while another shows 63.9%, and both are correct at their own precision. The math is the same, only the displayed decimals differ.

How do I copy a converted color into CSS?

Click Copy on any row in the results to copy it to your clipboard, then paste it into your stylesheet. HEX and hsl() both work in all modern browsers without any extra setup.

What is the closest Pantone to my HEX color?

Only approximate matching exists. Converters estimate it by measuring color distance, but screens and printed inks cover different ranges. For a real match, compare physical Pantone swatches under proper lighting.

That covers every format this color converter handles, from a pasted HEX code to a print-ready CMYK estimate. Looking for more everyday conversions? Browse our full set of unit converters.