Color Code Converter
Convert color codes between HEX, RGB, RGBA, HSL, CMYK, and 148 CSS named colors instantly. Free online color converter tool.
About
Color model mismatches cause silent failures across design-to-development handoffs. A designer specifies HSL for perceptual uniformity while a print vendor demands CMYK and the stylesheet requires HEX. Manual conversion invites rounding errors that compound through a palette of dozens of swatches. This tool converts between six color representations - HEX (3/4/6/8-digit), RGB, RGBA, HSL, CMYK, and the 148 CSS named colors - using a canonical RGBA intermediate to eliminate cascading precision loss. Conversions follow the sRGB color space model. Note: CMYK output is a mathematical approximation; physical print accuracy depends on ICC profiles and ink characteristics that this tool does not model.
Formulas
All conversions route through a canonical RGBA tuple. The RGB-to-HSL decomposition proceeds as follows:
For RGB to CMYK:
Where R, G, B are integer channel values in [0, 255], H is hue in degrees [0°, 360°), S and L are saturation and lightness as percentages, and C, M, Y, K are CMYK components as percentages. For pure black (K = 1), C = M = Y = 0.
Reference Data
| Named Color | HEX | RGB | HSL | CMYK |
|---|---|---|---|---|
| aliceblue | #F0F8FF | rgb(240, 248, 255) | hsl(208, 100%, 97.1%) | cmyk(5.9%, 2.7%, 0%, 0%) |
| coral | #FF7F50 | rgb(255, 127, 80) | hsl(16.1, 100%, 65.7%) | cmyk(0%, 50.2%, 68.6%, 0%) |
| cornflowerblue | #6495ED | rgb(100, 149, 237) | hsl(218.5, 79.2%, 66.1%) | cmyk(57.8%, 37.1%, 0%, 7.1%) |
| crimson | #DC143C | rgb(220, 20, 60) | hsl(348, 83.3%, 47.1%) | cmyk(0%, 90.9%, 72.7%, 13.7%) |
| darkcyan | #008B8B | rgb(0, 139, 139) | hsl(180, 100%, 27.3%) | cmyk(100%, 0%, 0%, 45.5%) |
| gold | #FFD700 | rgb(255, 215, 0) | hsl(50.6, 100%, 50%) | cmyk(0%, 15.7%, 100%, 0%) |
| forestgreen | #228B22 | rgb(34, 139, 34) | hsl(120, 60.7%, 33.9%) | cmyk(75.5%, 0%, 75.5%, 45.5%) |
| hotpink | #FF69B4 | rgb(255, 105, 180) | hsl(330, 100%, 70.6%) | cmyk(0%, 58.8%, 29.4%, 0%) |
| indigo | #4B0082 | rgb(75, 0, 130) | hsl(274.6, 100%, 25.5%) | cmyk(42.3%, 100%, 0%, 49%) |
| ivory | #FFFFF0 | rgb(255, 255, 240) | hsl(60, 100%, 97.1%) | cmyk(0%, 0%, 5.9%, 0%) |
| khaki | #F0E68C | rgb(240, 230, 140) | hsl(54, 76.9%, 74.5%) | cmyk(0%, 4.2%, 41.7%, 5.9%) |
| lavender | #E6E6FA | rgb(230, 230, 250) | hsl(240, 66.7%, 94.1%) | cmyk(8%, 8%, 0%, 2%) |
| limegreen | #32CD32 | rgb(50, 205, 50) | hsl(120, 60.8%, 50%) | cmyk(75.6%, 0%, 75.6%, 19.6%) |
| mediumaquamarine | #66CDAA | rgb(102, 205, 170) | hsl(159.6, 50.7%, 60.2%) | cmyk(50.2%, 0%, 17.1%, 19.6%) |
| midnightblue | #191970 | rgb(25, 25, 112) | hsl(240, 63.5%, 26.9%) | cmyk(77.7%, 77.7%, 0%, 56.1%) |
| olivedrab | #6B8E23 | rgb(107, 142, 35) | hsl(79.6, 60.5%, 34.7%) | cmyk(24.6%, 0%, 75.4%, 44.3%) |
| orangered | #FF4500 | rgb(255, 69, 0) | hsl(16.2, 100%, 50%) | cmyk(0%, 72.9%, 100%, 0%) |
| orchid | #DA70D6 | rgb(218, 112, 214) | hsl(302.3, 58.9%, 64.7%) | cmyk(0%, 48.6%, 1.8%, 14.5%) |
| peru | #CD853F | rgb(205, 133, 63) | hsl(29.6, 58.7%, 52.5%) | cmyk(0%, 35.1%, 69.3%, 19.6%) |
| rebeccapurple | #663399 | rgb(102, 51, 153) | hsl(270, 50%, 40%) | cmyk(33.3%, 66.7%, 0%, 40%) |
| salmon | #FA8072 | rgb(250, 128, 114) | hsl(6.2, 93.2%, 71.4%) | cmyk(0%, 48.8%, 54.4%, 2%) |
| seagreen | #2E8B57 | rgb(46, 139, 87) | hsl(146.5, 50.3%, 36.3%) | cmyk(66.9%, 0%, 37.4%, 45.5%) |
| slateblue | #6A5ACD | rgb(106, 90, 205) | hsl(248.3, 53.5%, 57.8%) | cmyk(48.3%, 56.1%, 0%, 19.6%) |
| steelblue | #4682B4 | rgb(70, 130, 180) | hsl(207.3, 44%, 49%) | cmyk(61.1%, 27.8%, 0%, 29.4%) |
| teal | #008080 | rgb(0, 128, 128) | hsl(180, 100%, 25.1%) | cmyk(100%, 0%, 0%, 49.8%) |
| tomato | #FF6347 | rgb(255, 99, 71) | hsl(9.1, 100%, 63.9%) | cmyk(0%, 61.2%, 72.2%, 0%) |
| turquoise | #40E0D0 | rgb(64, 224, 208) | hsl(174, 72.1%, 56.5%) | cmyk(71.4%, 0%, 7.1%, 12.2%) |
| violet | #EE82EE | rgb(238, 130, 238) | hsl(300, 76.1%, 72.2%) | cmyk(0%, 45.4%, 0%, 6.7%) |
| wheat | #F5DEB3 | rgb(245, 222, 179) | hsl(39.1, 76.7%, 83.1%) | cmyk(0%, 9.4%, 26.9%, 3.9%) |
| yellowgreen | #9ACD32 | rgb(154, 205, 50) | hsl(79.7, 60.8%, 50%) | cmyk(24.9%, 0%, 75.6%, 19.6%) |