Color Converter, HEX RGB HSL
Convert any color between HEX, RGB, and HSL, with a live swatch and a visual picker for when you only have a vague idea.
In your browser—your files never leave your device.
Learn more#hex, rgb(…), hsl(…)) into any field — auto-detected.About this tool
CSS supports a growing list of color formats — HEX, RGB, HSL, HWB, LAB, LCH, OKLAB, OKLCH, named colors — but the three you actually deal with day-to-day are HEX, RGB, and HSL. HEX is the most compact (#FF5733 is six characters) and standard in design tokens. RGB is what hardware actually does (red, green, blue intensity from 0-255 each). HSL is the one that matches how humans think about color (hue, then saturation, then lightness) and is best when you want to make a color "a bit darker" or "less saturated" without recalculating math. This converter is bidirectional across all three — change any value and the others recompute. A live swatch shows the result so you can sanity-check that #5F3DC4 really is the indigo you wanted before pasting it into your stylesheet.
How to color converter, hex rgb hsl
-
Enter a color or use the picker
Paste a HEX code, type RGB or HSL values in the format shown (255, 87, 51 for RGB; 11, 100%, 60% for HSL), or click the visual picker to choose visually. Whichever field you edit becomes the source of truth.
-
See all three formats update
Whatever format you edit becomes the source; the other two recompute on the fly via the standard conversion formulas. So edit HEX and watch RGB and HSL change; edit HSL and watch HEX and RGB change.
-
Check the swatch
The live preview shows the color at a useful size so you can confirm it is right before copying. Particularly useful when working in HSL — a small change in hue can shift the perceived color a lot, and the swatch tells you whether you got the indigo or the violet you intended.
-
Copy the format you need
Each format has its own copy button. The output is CSS-ready, so paste directly into your stylesheet, design token file, or component prop. The format string includes the surrounding syntax (rgb(...) or hsl(...) or the hash for HEX), so no post-processing needed.
Why use this tool
Design handoff is the everyday case. The designer's Figma file has colors in HEX, the CSS framework I am using wants HSL for theming variables, the Tailwind palette generator wants RGB triples. Converting between them by hand is annoying enough that a fast tab beats a calculator. The second case is dark-mode design — taking a brand color and finding a "20% lighter" version that still reads as the same hue, which is much easier in HSL (just bump the L value) than in RGB. The third case is debugging a color that "looks slightly wrong" in CSS — pasting the HEX in here and watching the swatch tells you whether the value is what you typed or whether some build step has been transforming it (a Sass darken() call, a Tailwind opacity modifier). The fourth: CSS variable definitions in HSL components so opacity is easy (hsl(217 91% 60% / 0.5) is cleaner than computing the equivalent RGBA from scratch). The fifth is reverse-engineering a competitor's color palette from a screenshot — color-pick from the image, paste the HEX, see all three formats.
Features
Bidirectional across all three formats
Edit any of HEX, RGB, or HSL and the other two update in real time. So you can paste an RGB from a screenshot tool, see the HEX equivalent for your CSS, and the HSL equivalent for your theme variables, all without leaving the tool. The math is done with the standard HSL ↔ RGB conversion formulas; rounding errors at the integer level mean a few round-trips between formats may shift a value by one unit, which is below perceptual threshold.
Visual picker
When you do not know the values yet — you have a vague idea of "warm orange but not too bright" — click the picker, drag to find what you want, and copy the values once it looks right. Faster than typing trial-and-error HEX codes and hitting refresh. The picker is the browser's built-in color input, which means it inherits whatever the user's OS picker looks like (a richer experience on macOS, a simpler one on Windows, sometimes nothing on older mobile browsers).
Live swatch
A preview swatch shows the current color in real size. Useful for sanity-checking whether your HSL math gave you the indigo you intended or accidentally rotated the hue to teal. The swatch updates in real time as you edit any value, so you see the consequence of your edit immediately rather than having to reload a stylesheet.
CSS-ready output
Each format outputs in the exact syntax you paste into stylesheets: #FF5733 (HEX, with the hash), rgb(255, 87, 51) (RGB function form), hsl(11, 100%, 60%) (HSL function form). Copy buttons next to each. No need to wrap or reformat — the output is the literal string you would write in CSS.
Privacy & security
Color math is a few lines of arithmetic — HSL ↔ RGB ↔ HEX conversions are documented in CSS Color Level 3 and the implementation here is the standard one, running on your machine. The visual picker uses the browser's native <input type="color">, which itself is local and inherits from your OS color dialog. The live swatch updates by writing to a DOM element's style. No analytics on what colors you picked, no server-side anything.