RevealTheme logo

Color Converter (HEX/RGB/HSL)

Pick a color or paste a 6-digit HEX code and instantly read its RGB and HSL equivalents. Conversion runs one way, from HEX to RGB and HSL, entirely in your browser.

HEX
#535beb
RGB
rgb(83, 91, 235)
HSL
hsl(237, 79%, 62%)

How to use this tool

  1. 1

    Click the color swatch to open your operating system's color picker and choose a color visually.

  2. 2

    Or type a 6-digit HEX value (such as #535beb, with or without the leading #) into the text field.

  3. 3

    Read the matching rgb(R, G, B) and hsl(H, S%, L%) strings in the result cards below.

  4. 4

    Copy whichever format you need straight into your CSS or design file.

How does HEX to RGB and HSL conversion work?

HEX, RGB, and HSL all describe the same point in the sRGB color space, just with different notation. A HEX code like #535beb packs three bytes: 53, 5b, and eb in base 16, which are the red, green, and blue channels. This tool reads those two-hex-digit pairs and converts each to a 0-255 decimal value, giving you rgb(83, 91, 235). HSL is derived from those RGB numbers: hue is the angle on the color wheel (0-360 degrees), saturation is how vivid the color is (0-100%), and lightness is how bright it is (0-100%). The math finds the max and min of the three channels to compute lightness, scales their difference for saturation, and picks the dominant channel to compute hue, then rounds each result to a whole number. Because rounding happens, converting HEX to HSL and back by hand may shift a value by one. The tool only parses standard 6-digit HEX; 3-digit shorthand (#abc), 8-digit HEX with alpha, and named colors like rebeccapurple are not recognized and fall back to black.

Common use cases

  • Translating a brand HEX code from a style guide into the rgb() values a legacy stylesheet or email template requires.

  • Grabbing the HSL form of a color so you can nudge its lightness or saturation while keeping the same hue for a palette.

  • Checking the exact RGB channels of a color picked from a screenshot or mockup before writing it into CSS.

  • Confirming what a designer's HEX swatch becomes in RGB for a canvas, SVG, or charting library that wants numeric channels.

  • Teaching or learning how hexadecimal color notation maps to decimal RGB and to the HSL model.

  • Quickly sampling a color visually with the picker and reading all three CSS-ready notations at once.

Frequently asked questions

Can I convert RGB or HSL back into HEX with this tool?
No. Conversion is one-directional: you supply a HEX code (by picker or text), and the tool outputs the matching RGB and HSL. The RGB and HSL fields are read-only results, not editable inputs.
Why does my color turn black when I type something?
The parser only accepts a standard 6-digit HEX code, optionally with a leading #. Anything else, including 3-digit shorthand like #abc, 8-digit HEX with alpha, or named colors like 'tomato', does not match and falls back to #000000 (black). Type the full six characters to fix it.
Does it support alpha or transparency?
No. It handles only the red, green, and blue channels. There is no alpha channel, so 8-digit HEX (#RRGGBBAA), rgba(), and hsla() are not produced or accepted.
Are HEX letters case sensitive?
No. The HEX parser is case insensitive, so #535BEB and #535beb give the same result. The color picker returns lowercase HEX.
Why is the HSL value slightly off from another converter?
Hue, saturation, and lightness are each rounded to whole numbers for readability. Other tools may keep decimals or round differently, so a value can differ by one. The underlying color is identical.
Does it handle OKLCH or other modern color spaces?
No. This tool works only in HEX, RGB, and HSL within the sRGB space. For OKLCH, LCH, or wide-gamut color, use a dedicated CSS Color Level 4 converter.
Is my color data uploaded anywhere?
No. All parsing and conversion happen locally in your browser with JavaScript. No color values are sent to a server, and nothing is stored or transmitted.

Related tools