How to Use This Tool
Hex and RGB are the same information written two ways. A hex code is three pairs of base-16 digits, one
per colour channel, each running from 00 to FF — which is 0 to 255 in the
decimal notation CSS's rgb() function uses. Converting between them is arithmetic, not
translation, and nothing is lost in either direction.
What you can paste in
The input accepts more than hex. All of these describe the same colour and all of them work:
- 6-digit hex —
#2B7FFF, the everyday form. The hash is optional. - 3-digit shorthand —
#2BFexpands to#22BBFFby doubling each digit. Note that this only reaches 4,096 of the 16.7 million possible colours, so it cannot represent most brand colours exactly. - 8-digit hex —
#2B7FFF80, where the last pair is alpha.80is 128, which is roughly 50% opacity. This is supported by every current browser and is much more compact than writingrgba(). - 4-digit hex — shorthand with alpha, expanded the same way.
- Functional notation — paste
rgb(43 127 255)orhsl(217 100% 58%)straight from a stylesheet and it converts back.
The other formats, and when each is worth using
HSL separates hue, saturation and lightness, which makes it far easier to hand-tune a colour: changing lightness while holding hue produces a sensible tint, whereas nudging RGB channels usually shifts the hue as a side effect. HSV is what most design tools' colour pickers use internally, so it is the format that matches the sliders in Figma or Photoshop. OKLCH is perceptually uniform, meaning equal numeric steps look like equal visual steps — which is exactly what you want when generating a colour scale, and exactly what HSL fails at.
The tint and shade scale
The strip at the bottom generates a 50-to-900 ramp from your colour, the shape design systems and Tailwind expect. It works in OKLCH rather than HSL, so the steps are perceptually even instead of bunching up in the yellows and spreading out in the blues. Copy it as CSS custom properties and paste it into a stylesheet. The contrast figures above it tell you immediately whether your colour is usable as text on white or on black, which decides half your design decisions before you make them.