The same color can be written in several ways, and each format suits a different job. They all describe the colors a screen can show, so converting between them only changes how the numbers are written, except for CMYK, which is built for ink.
HEX
A HEX code such as #ff6600 is RGB written in base 16: two digits each for red, green and blue, from 00 to ff. It is short, easy to copy and the most common way to write colors in CSS, HTML and design tools. An optional fourth pair adds transparency.
RGB and RGBA
RGB gives the amount of red, green and blue light from 0 to 255, such as rgb(255, 102, 0). It maps directly to how screens work, so it is used in code, canvas drawing, image editing and anywhere you calculate colors. RGBA adds an alpha value from 0 (fully transparent) to 1 (solid).
HSL and HSV
HSL describes a color by hue (its position on the color wheel, 0 to 360 degrees), saturation (how vivid) and lightness (how close to black or white). It is the easiest format for making a color lighter, darker or softer while keeping its character. HSV, also called HSB, uses value or brightness instead of lightness and is common in Photoshop and color pickers. CSS supports HSL but not HSV.
CMYK
CMYK is for print: the percentages of cyan, magenta, yellow and black ink. The conversion here uses the standard formula. CMYK values are an approximation for screen colors; printed colors depend on the printer profile, the paper and the press.
Which format should you use?
- Websites and apps: HEX for solid colors, RGBA or 8-digit HEX for transparency, and HSL when you want a theme that is easy to adjust.
- Design tools: HEX to share colors, HSB/HSV inside color pickers.
- Print: CMYK as a starting point, confirmed with your printer, or a spot color for exact brand matches.
Picking colors from your screen or an image
In Chrome and Edge on a computer, Pick from screen turns your pointer into an eyedropper: click anywhere, even outside the browser, and that exact color is loaded. In other browsers the button is hidden, because they do not offer this feature yet.
To take a color from a photo, logo or screenshot, use Pick a color from an image. JPG, PNG, WebP, AVIF and iPhone HEIC files are supported. A magnifier shows the pixel under your pointer or finger, so you can pick exactly the shade you want. The image is opened in your browser and never uploaded. If you need the image itself in another format, the Image Converter can turn it into JPG, PNG or WebP.
Shades, tints and harmonies
Shades are your color mixed with increasing amounts of black, and tints are your color mixed with white. Together they give a ready scale for buttons, hover states, borders and backgrounds that all belong to the same family. Click any swatch to make it the current color and copy its codes.
Harmonies come from the color wheel. A complementary color sits opposite yours and gives the strongest contrast; analogous colors sit next to it and feel calm; triadic, split-complementary and tetradic schemes spread three or four colors evenly around the wheel. They keep the same saturation and lightness, so the palette feels balanced. Use one main color and the others as accents.
Contrast and accessibility (WCAG)
Text must stand out from its background so that everyone, including people with low vision or color blindness, can read it. The Web Content Accessibility Guidelines measure this as a contrast ratio from 1:1 (no contrast) to 21:1 (black on white).
- AA: at least 4.5:1 for normal text and 3:1 for large text (about 24 px, or 18.66 px bold).
- AAA: at least 7:1 for normal text and 4.5:1 for large text.
The checker tests your color as text on white, on black and on a second color you choose, and shows a live sample. Transparent colors are blended with the background first, because that is what people actually see. If a color fails, try a darker shade or a lighter tint from the list until it passes.
Tips
- Store brand colors in one format, usually HEX, and convert from that, rather than converting a converted value again.
- When a design must work in print, check the CMYK version early: very bright screen colors often print duller.
- Share a color with a colleague by copying the page address; it includes the current color.
- Working with physical sizes or other measurements as well? The Unit Converter handles lengths, weights, areas and more.