Colour Converter - HEX, RGB, HSL Converter Online
About the Colour Converter
CSS supports multiple colour formats, and switching between them is a routine part of front-end development. A designer hands you a hex code, but your design tokens are in HSL. A library returns RGB values, but you need the hex string for a config file. This converter handles all three formats (HEX, RGB, HSL) with instant two-way conversion. Type in any field and every other field updates in real time, along with a live preview swatch so you can confirm the colour visually.
The built-in colour picker syncs with all three inputs, giving you a visual way to explore colours and immediately see their numeric representations. Copy any format with a single click.
How to Use the Colour Converter
Enter a colour value in any of the three input sections: type a hex code
like #3b82f6 in the HEX field, enter channel values in the
RGB fields (0–255 each), or set hue, saturation, and lightness in the
HSL fields. Every other input and the preview swatch update as you type.
Use the native colour picker to browse colours visually. Click the Copy
button next to any format to copy the formatted value to your clipboard.
Features
- Live preview. A large colour swatch updates in real time as you edit any input field.
- Three-way sync. Editing HEX, RGB, or HSL instantly updates the other two formats.
- Native colour picker. Use your browser's built-in colour picker for visual selection, synced with all fields.
- One-click copy. Copy the formatted HEX, RGB, or HSL string directly to your clipboard.
- Flexible input. Accepts 3-digit and 6-digit hex codes, with or without the # prefix.
Colour Formats in CSS
Modern CSS accepts all three formats interchangeably. HEX codes like
#3b82f6 are the most compact and widely used in design
handoffs. RGB notation like rgb(59, 130, 246) is explicit
about channel values and pairs well with opacity via
rgba(). HSL notation like
hsl(217, 91%, 60%) maps more closely to how humans think
about colour and makes it straightforward to build consistent palettes
by adjusting lightness or saturation. Knowing all three and being able
to convert between them quickly makes your CSS workflow more flexible.