JustFreeTools.
◎   English
EnglishEspañolالعربية
← All tools
Developer

Color converter — HEX, RGB & HSL

Convert HEX to RGB and HSL, RGB to HEX, or HSL to RGB. Paste a color code or use the picker, preview the color, and copy each format. Free and browser-only.

● Your files stay yours

Loading converter…

Examples: #abc · rgb(255, 128, 0) · hsl(240 100% 50%)

Try an example format

Copy your color

RGB channels round to the nearest 8-bit integer. HEX and RGB match exactly; HSL is calculated from that RGB color and rounded to two decimals.

How to use this tool

Paste a supported HEX, rgb() or hsl() value. Results update immediately. You can also choose a color with the picker or try a format example. Copy the format you need; Clear removes the input and results.

Good to know

Opaque sRGB colors only. HEX: 3 or 6 digits, with or without #. RGB: three values from 0–255, or three percentages from 0–100%. HSL: hue 0–360 (optional deg), saturation and lightness 0–100% with percent signs. Commas or spaces are accepted. Decimal point: period; Arabic/Persian digits work. No alpha, named colors, CSS variables, other angle units, CMYK or wide-gamut colors. Inputs stay in memory and are not uploaded or saved.

HEX, RGB and HSL conversion examples

These notations describe sRGB colors in different ways. HEX uses hexadecimal channel values; RGB uses red, green and blue channels; HSL uses hue, saturation and lightness. The examples below represent the same color across each row.

HEXRGBHSL
#FF0000rgb(255, 0, 0)hsl(0, 100%, 50%)
#00FF00rgb(0, 255, 0)hsl(120, 100%, 50%)
#0000FFrgb(0, 0, 255)hsl(240, 100%, 50%)

Color conversion questions

How do I convert HEX to RGB?

Split a six-digit HEX code into three pairs and convert each pair from base 16 to decimal. #FF8000 becomes rgb(255, 128, 0). A short code duplicates each digit: #abc becomes #AABBCC.

How do I convert RGB or HSL to HEX?

Paste rgb(255, 128, 0) or hsl(30, 100%, 50%). The converter calculates whole-number RGB channels, then writes each channel as two hexadecimal digits.

Why can HSL conversion change a value slightly?

HSL can describe values between 8-bit RGB steps. This tool rounds to whole RGB channels first, then calculates HSL to two decimals. Small numerical differences can occur when converting back and forth.

Why does a gray color have hue 0?

Gray has zero saturation, so hue does not affect its appearance. The converter uses hue 0 for this case.

Does this check contrast or convert print colors?

No. Use the related contrast checker for text/background contrast. CMYK requires a print color profile and is outside this tool’s scope.