Color Converter

Convert between HEX, RGB, HSL color formats.

HEX#7c5cfc
RGBrgb(124, 92, 252)
HSLhsl(252, 96%, 67%)

Three Notations, One Color

Pick a color visually or type a HEX code, and the tool shows all three CSS notations side by side — click any value to copy it. They describe the exact same color, just in different coordinate systems:

FormatExampleWhat the numbers mean
HEX#7c5cfcRed, green, blue as hex pairs, 00–ff
RGBrgb(124, 92, 252)Same three channels in decimal, 0–255
HSLhsl(252, 96%, 67%)Hue on the color wheel (0–360°), saturation, lightness

Worked Example: Reading #7c5cfc

HEX to RGB is direct base conversion: 7c = 7×16+12 = 124 red, 5c = 92 green, fc = 252 blue. Blue is the strongest channel with some red mixed in, so the color lands in the violet range — HSL confirms it: hue 252° sits between blue (240°) and magenta (300°), saturation 96% means it's nearly pure, and lightness 67% puts it on the pale side of the midpoint. HEX and RGB are interchangeable notations of the same values; HSL is a genuine re-mapping, which is why its values look unrelated at first glance.

Which Format When

  • HEX is the compact default for CSS, design handoffs and brand guidelines — easy to copy, hard to mistype.
  • RGB matches how screens and graphics APIs actually work, and extends naturally to transparency as rgba().
  • HSL is the format for adjusting colors: need a hover state? Keep hue and saturation, drop lightness by 10%. Need a complementary accent? Rotate hue by 180°. Doing that math in HEX is miserable; in HSL it's one number.

A practical workflow: pick your brand color with the visual picker, copy the HSL value, and derive your palette (hover, borders, backgrounds) by varying only the lightness — the shades stay visually related automatically.

Input Rules and Privacy

The text field accepts full six-digit HEX codes with a leading # (shorthand like #fff should be expanded to #ffffff). The picker updates all formats live, and HSL values are rounded to whole numbers — converting back can shift a value by ±1, which is invisible on screen. All conversion runs entirely in your browser; nothing is sent to a server.

Frequently Asked Questions

What color formats are supported?
HEX (e.g. #7c5cfc), RGB (e.g. rgb(124, 92, 252)) and HSL (e.g. hsl(252, 96%, 67%)). Enter a HEX code or use the visual picker, and all three update live.
How do I convert HEX to RGB by hand?
Split the code into three hex pairs and convert each to decimal: #7c5cfc → 7c=124, 5c=92, fc=252 → rgb(124, 92, 252). Each pair ranges from 00 (0) to ff (255).
Why use HSL instead of HEX?
HSL separates hue, saturation and lightness, so adjustments become arithmetic: darken a button hover by lowering lightness, or find a complementary color by rotating hue 180°. HEX offers no such handles.
Why does converting to HSL and back change the value slightly?
HSL values are rounded to whole numbers for readability, so a round trip can shift a channel by about ±1 — an imperceptible difference on screen.
Is my color data sent anywhere?
No. All conversions run locally in your browser — nothing is transmitted to a server.