Color Converter
Pick a colour or type a HEX, RGB or HSL value and get every other format instantly, ready to paste into CSS.
Runs in your browser. Your files are never uploaded.
Loading Color Converter…
How to use Color Converter
- Use the picker or type a colour value.
- See the live swatch and the converted HEX, RGB and HSL.
- Press copy to paste it into your stylesheet.
Colour formats on the web
HEX, RGB and HSL describe the same colours in different ways. HEX is compact and the most common in design handoffs. RGB mirrors how screens mix red, green and blue light. HSL is the friendliest for humans: to get a darker shade, simply lower the lightness.
Working with HSL
- Hue picks the base colour: 0 is red, 120 green, 240 blue.
- Saturation 0% is grey; 100% is fully vivid.
- Lightness 0% is black, 50% is the pure colour, 100% is white.
- Build a palette by keeping hue and saturation fixed while changing lightness.
Accessibility reminder
Whatever format you use, check that text colours contrast enough with their background. WCAG recommends a contrast ratio of at least 4.5:1 for normal body text. A colour that looks fine to you can be unreadable for people with low vision or in bright sunlight.
Choosing colours for the web
Pick a small palette: one primary colour, one accent and a set of neutrals. Convert the primary to HSL and create lighter and darker variations by changing only the lightness, which keeps the shades visually related. Use darker shades for text and lighter tints for backgrounds.
Check combinations for contrast before shipping. As a rough guide, text and background lightness values that differ by less than about 40 points in HSL often fail accessibility checks, though a proper contrast ratio calculation is the reliable test.
Why use this color converter tool
- Three formats. HEX, RGB and HSL in one view.
- Flexible input. Accepts #abc, #aabbcc, rgb() and hsl().
- CSS-ready. Includes a custom property line.
Frequently asked questions
How do I convert HEX to RGB?
Split the six hex digits into three pairs and convert each from base 16. #1b5faa is 1b=27, 5f=95, aa=170, so rgb(27, 95, 170).
What is HSL?
HSL stands for hue (0–360° on the colour wheel), saturation (colour intensity) and lightness. It is easier to reason about than RGB when you want a lighter or duller shade.
Does it support transparency?
Alpha values are ignored; the tool converts the opaque colour.
More free tools
PX to REM Converter
Convert pixels to rem and em, and back, with a custom root font size. Includes a table of common sizes from 8px to 64px and a copy-ready CSS declaration.
Open toolBase64 Encode & Decode
Encode text to Base64 or decode Base64 back to text. Supports UTF-8 and URL-safe Base64. Free, instant and runs in your browser.
Open toolURL Encode & Decode
Encode or decode URLs and query strings with percent-encoding. Choose component or full-URL mode. Free, instant and private.
Open tool