Color converter
Paste a color in HEX, rgb() or hsl() notation and get all three formats at once, a live preview, and a ready-made tint/shade scale for your design tokens.
How to use
- Paste any of these:
#3d5afe,3d5afe,#35f,rgb(61, 90, 254),rgba(61, 90, 254, 0.5), orhsl(231, 99%, 62%). - The native color picker on the right is a shortcut — pick, and the fields fill in.
- Click any swatch in the tint/shade strip to load that color back into the converter.
Which format for which job
- HEX — the CSS default: compact, unambiguous, copy-paste friendly. 3-digit form expands by doubling each digit (
#35f=#3355ff). - RGB — clearest when alpha matters (
rgba), and the format every canvas and graphics API speaks underneath. - HSL — the one humans can reason about: hue is the angle on the color wheel, saturation how vivid, lightness how bright. Building hover states or a design-token scale? Step the lightness and keep hue fixed — HSL makes the relationship visible.
How the tint/shade scale is built
The strip mixes your color with white at 60%, 40%, 20% (tints) and with black at 20%, 40%, 60% (shades), computed in RGB space. That gives you a consistent 7-step ramp out of a single base color — enough for hover, active and disabled states in most UIs. For pixel-perfect perceptual ramps, design systems graduate to OKLCH, but a linear mix is what most component libraries ship.
FAQ
Why does my HSL value look different after conversion?
HSL values are rounded to whole degrees and percentages, and RGB values to whole channels. A color converted hex → hsl → hex can drift by 1/255 per channel. That is invisible to the eye and unavoidable with 8-bit channels.
Does it support 8-digit hex with alpha?
Yes — #3d5afe80 is read as RGB with 50% alpha, and the alpha value is kept in the RGB output (rgba(…)). Note that HSL in CSS does not carry alpha, so the HSL output describes the color without transparency.
Are hex and rgb the same color space?
Yes — sRGB. A hex string is just base-16 notation for the same three (or four) channel numbers. Only wider gamuts like Display-P3 need more than 8 bits per channel, and browsers handle that separately.