Colour converter

Converts colour between HEX, RGB and HSL — with live preview and a palette of 148 standard CSS colours.

01Converter02Palette03About formats04Related
01

Converter & preview

#c8002a
CSS name
Values
HEX
RGB
HSL
02

Standard CSS colours

Click a colour — it loads into the converter
Reds
Pinks
Oranges
Yellows
Greens
Blues & Cyans
Purples
Browns
Whites & Grays
03

About colour formats on the web

Value ranges
Format
Components
Range
Example
HEX
RR GG BB (AA)
00–FF per channel
#c8002a
RGB
R, G, B (A)
0–255; alpha 0–1
rgb(200, 0, 42)
HSL
H, S, L (A)
0–360°; 0–100%; alpha 0–1
hsl(348, 100%, 39%)
HWB
H, W, B
0–360°; 0–100%; 0–100%
hwb(348 0% 22%)

On the web, the same colour can be written in several ways. All three main formats — HEX, RGB and HSL — are supported in every modern browser and CSS preprocessor. The choice is a matter of convenience and team conventions.

HEX

Most popular
#c8002a · #C8002A · #f00 = #ff0000
Hexadecimal encoding of three bytes: #RRGGBB. Each pair is a channel value from 00 to FF. Short form #RGB expands to #RRGGBB. Case-insensitive. Supports transparency: #RRGGBBAA.

RGB

For JS & Canvas
rgb(200, 0, 42) · rgba(200, 0, 42, 0.5)
Three channels Red / Green / Blue, each 0 to 255. The rgba() form adds a fourth parameter — opacity 0 (transparent) to 1 (opaque). Convenient for calculations and animations in JavaScript.

HSL

For designers
hsl(348, 100%, 39%) · hsla(H, S%, L%, a)
Hue — angle on the colour wheel 0–360°. Saturation — 0% grey, 100% pure. Lightness — 0% black, 50% colour, 100% white. Easy to create light/dark variants — just change L.

When to use what

Practice
design system → HSL · Figma → HEX · JS → any
HEX — the standard for design handoff, copied from Figma. RGB — for dynamic styles in JS, Canvas, SVG filters. HSL — for design tokens where you manage variants like --color-500, --color-600.
«» added to favorites