Color Converter
Convert colors between HEX, RGB, HSL and CMYK with a live preview.
The Color Converter translates any color between the four notations developers and designers actually use: HEX (#4f46e5), RGB, HSL and CMYK. Pick a color visually or type a hex value — every equivalent appears instantly with a live preview swatch and copy buttons.
Each notation fits a different job: HEX is the shorthand of HTML and CSS; RGB matches screens and canvas code; HSL expresses hue, saturation and lightness in a way humans can reason about ('a lighter blue'); CMYK is the language of print. Translating between them by hand is error-prone — the math involves rounding, gamma-free channels and saturation edges — which is exactly why a converter earns its place in every styling workflow.
Conversion runs locally in your browser, accepts 3- or 6-digit hex with or without the #, and validates your input instead of returning garbage. The color picker is a fast way to explore new values.
#4f46e5rgb(79, 70, 229)hsl(243, 75%, 59%)cmyk(66%, 69%, 0%, 10%)How to use the Color Converter
- Pick a color from the swatch picker, or type a hex value.
- Read the matching HEX, RGB, HSL and CMYK values.
- Check the live preview swatch.
- Copy whichever format your code, stylesheet or design tool needs.
- Edit the hex to convert any color you already have.
Frequently asked questions
How do I convert hex to RGB?
Split the six hex digits into pairs and convert each from base 16: #4F46E5 → R=0x4F=79, G=0x46=70, B=0xE5=229, giving rgb(79, 70, 229). The converter does this instantly, and also handles shorthand #rgb values by doubling each digit.
When should I use HSL instead of HEX?
HSL is human-readable: you can estimate what 'hsl(240, 70%, 60%)' looks like (a mid-light blue) in a way hex never allows. It also makes systematic tweaks easy — shift the lightness for hover states or the hue for color ramps.
Why does CMYK appear for a screen color?
CMYK describes subtractive print mixing, so converting a screen color to CMYK approximates how it would print. Colors outside the print gamut (like vivid neon greens) have no exact CMYK equivalent — the values shown are the closest printable match.
Related tools
View all developer tools →JSON Formatter & Validator
Format, minify and validate JSON instantly with clear error messages that point at the exact problem.
Dev ToolsJSON Validator
Check if your JSON is valid and find syntax errors with exact line and column.
Dev ToolsJSON Minifier
Compress JSON to its smallest valid form for storage and transport.
Dev ToolsJSON to CSV
Convert a JSON array of objects into a clean CSV file in one click.
Dev ToolsCSV to JSON
Convert CSV (from Excel or Google Sheets) into a JSON array of objects.
Dev ToolsBase64 Encoder
Encode text or files to Base64 — standard or URL-safe — in your browser.