Color Converter (HEX to RGB & HSL)
Convert web colors from 3-digit (#RGB) or 6-digit (#RRGGBB) HEX codes into RGB (rgb(r, g, b)), HSL (hsl(h, s%, l%)), and CSS Custom Property variable syntax. Features a native color picker, a live luminance-aware preview swatch, and individual one-click Copy buttons.
How to Use Color Converter (HEX to RGB & HSL)
Click the visual color picker square or type a 6-digit (`#RRGGBB`) or 3-digit shorthand (`#RGB`, which expands each nibble such as `#26F` → `#2266FF`) hexadecimal code into the **HEX Code** input field (default `#2563EB`). The converter parses the red, green, and blue channels (`0–255`), computes the cylindrical Hue (`0–360°`), Saturation (`0–100%`), and Lightness (`0–100%`) values, and updates the top preview banner—automatically switching the preview text between dark (`#0f172a`) and white (`#ffffff`) based on relative luminance (`(0.299×R + 0.587×G + 0.114×B) ÷ 255`). Below the input, click **Copy** next to any of the four output rows: **HEX** (`#2563EB`), **RGB** (`rgb(37, 99, 235)`), **HSL** (`hsl(221, 83%, 53%)`), or **CSS Variable Format** (`--brand-color: #2563EB;`). Checking image transparency or photo metadata? Visit our Transparent Background Checker and Image Metadata Viewer.
- 1
Type a HEX Code or Use the Color Picker
Enter a 6-digit (#RRGGBB) or 3-digit (#RGB) hex string in the HEX Code field, or click the color picker swatch.
- 2
Preview the Contrast-Adaptive Swatch
Inspect the live top color banner displaying the uppercase HEX code and rgb(r, g, b) values.
- 3
Compare HEX, RGB, HSL & CSS Variable Rows
Read the converted RGB channels (0–255), HSL (degrees and percentages), and CSS Custom Property syntax.
- 4
Copy Any Color Format in One Click
Click the Copy button next to HEX, RGB, HSL, or CSS Variable Format to paste into your stylesheet.
Converting Default Royal Blue (#2563EB) to RGB, HSL & CSS Variable Format
The 6-digit hexadecimal code splits into three base-16 byte pairs (25, 63, EB) before converting to RGB and HSL.
Default 6-digit HEX code (3-digit #RGB shorthand codes are also automatically expanded).
R = 37, G = 99, B = 235 · Max = 0.922, Min = 0.145 → Hue = 221°, Saturation = 83%, Lightness = 53%.
CSS Variable Format: --brand-color: #2563EB; · Preview text: #ffffff (luminance 0.377 ≤ 0.5).
Related Free Tools
Explore more browser-based tools in Daily & Text Utilities or browse the complete All Tools Directory.
Format, beautify, validate, and minify JSON online with 2-space or 4-space indentation, syntax error alerts, copy, and .json download.
Generate static 400×400 px PNG QR codes for website URLs, plain text, Wi-Fi networks, email links, and phone numbers with custom colors.
Check if a PNG, WebP, SVG, or GIF has a real transparent background or a fake baked-in checkerboard pattern.
View image file properties online: pixel dimensions, total megapixels, aspect ratio, orientation, exact byte size, MIME type, color depth, and last-modified date.