Color Converter

Pick a color or type any HEX, RGB or HSL value and get every format instantly, plus copy-ready CSS snippets.

All conversions happen locally in your browser. Nothing leaves your device.

—
color: #3498db;
background-color: rgb(52, 152, 219);
background-color: hsl(204, 70%, 54%);

Color Space Basics

Every color on screen is just a set of numbers in a coordinate system. The three systems below describe the same colors in different ways — a HEX code, an RGB triple and an HSL triple for #3498db are the very same blue. Knowing all three makes it easy to read design specs, debug stylesheets and generate variants.

HEX (#rrggbb)
Base-16 encoding of the three RGB channels: two hex digits per channel (00–ff). The 3-digit form #rgb is shorthand where each digit is duplicated. Compact and the de-facto standard for design tokens and CSS.
RGB — Red, Green, Blue
An additive model: light from three channels is mixed, each channel ranging 0–255. rgb(52, 152, 219) is exactly #3498db (52=0x34, 152=0x98, 219=0xdb). The rgba() variant adds an alpha channel for transparency.
HSL — Hue, Saturation, Lightness
Hue is a position on the 0–360° color wheel (204° here is a sky blue). Saturation 0–100% controls how vivid the color is; lightness 0–100% from black through full color to white. Most intuitive for creating shades, tints and tonal variations.

Frequently Asked Questions

What is the difference between HEX, RGB and HSL?

HEX is a compact base-16 notation for RGB values (#rrggbb). RGB mixes red, green and blue channels, each from 0 to 255. HSL describes color by hue, saturation and lightness, which matches how humans think about color and makes it easy to tweak shades and tints.

Which format should I use in CSS?

All three work in every modern browser. HEX is shortest and most common for design handoff. RGB is convenient when you need to build an rgba() value with alpha. HSL is best when you want to adjust a color's brightness or intensity without changing its base hue.

What are the 3-digit HEX codes?

Shortcodes like #f0a are shorthand: each digit is duplicated, so #f0a expands to #ff00aa. This tool accepts both 3-digit and 6-digit HEX, with or without the leading #.

How is HSL converted to RGB?

Hue (0–360°) is mapped onto the color wheel, then saturation and lightness scale the color toward gray or black. The standard HSV→RGB formulas do the math, and the result is rounded to the nearest integer 0–255 value for each channel.

Does the tool validate my input?

Yes. As you type, the tool parses each field and only updates the swatch and the other fields when the value is valid. Out-of-range numbers, malformed formats or missing components simply leave the last valid color in place until you fix the input.

Once you settle on a color, keep the workflow moving: convert the value with the Hex to RGB Converter, pull a palette straight from a photo with the Color Picker from Image, and check how the result reads for everyone in the Color Blindness Simulator before you ship it.