Color Converter
Convert colors between HEX, RGB, and HSL formats.
Enter a color in HEX, RGB, or HSL format.
Understanding Color Formats
Colors on the web are expressed in several notation systems, each with distinct advantages. The three most common are HEX, RGB, and HSL. Converting between them is a routine task for web developers, UI designers, and anyone working with digital color. This tool performs instant, client-side conversion so you can move between formats without leaving your browser.
HEX Colors
HEX (hexadecimal) notation represents colors as a six-character string prefixed with a hash sign, like #3b82f6. Each pair of characters encodes the red, green, and blue channels as values from 00 to FF (0–255 in decimal). HEX is the most widely used color format in CSS and design tools because it is compact and easy to copy-paste. Shorthand three-character HEX codes (e.g., #f00 for red) are also supported.
RGB Colors
RGB stands for Red, Green, Blue — the additive color model used by screens and monitors. In CSS, RGB colors are written as rgb(59, 130, 246), with each channel ranging from 0 to 255. RGB is intuitive when you think in terms of light mixing: rgb(255, 0, 0) is pure red, rgb(0, 255, 0) is pure green, and rgb(255, 255, 255) is white. RGBA extends this with an alpha channel for transparency.
HSL Colors
HSL stands for Hue, Saturation, Lightness. Hue is a degree on the color wheel (0–360), saturation is a percentage of color intensity, and lightness is a percentage from black (0%) to white (100%). HSL is often preferred by designers because it maps more naturally to how humans perceive color. Adjusting lightness to create shades and tints, or tweaking saturation to mute a color, is straightforward in HSL. In CSS it is written as hsl(217, 91%, 60%).
When to Use Each Format
Use HEX for quick CSS values and design handoffs. Use RGB when you need to manipulate individual color channels programmatically. Use HSL when creating color palettes, themes, or accessible contrast variations. This converter shows all three formats simultaneously so you always have the right notation at hand.