Color Code Converter

Convert color codes instantly with our Color Code Converter. Easily convert HEX, RGB, HSL, and CMYK color formats for web design, graphic design, and development. Fast, accurate, and free online color converter tool.

Color Code Converter
Please enter a valid color code
Color code copied to clipboard!
Color Conversions
HEX
#F661B8
RGB
rgb(246, 97, 184)
HSL
hsl(325, 89%, 67%)
CMYK
cmyk(0%, 61%, 25%, 4%)
HSV
hsv(325, 61%, 96%)
Live Preview & Text Samples
#F661B8
Normal Text (White)
Large Text (White)
Normal Text (Black)
Large Text (Black)
Contrast Checker (WCAG Accessibility)
2.87:1
Contrast against white
7.32:1
Contrast against black
WCAG Guidelines: For normal text, aim for at least 4.5:1 contrast ratio. For large text (18pt+ or 14pt+bold), 3:1 is sufficient. AAA level requires 7:1 for normal text.
💡 Tip: Accepts all common CSS color formats. For best results, use 6-digit HEX codes (#RRGGBB). You can also use named colors like "red", "blue", or "transparent".

🧭 User Guide

  1. Enter any color code in the input field above (HEX, RGB, HSL, CMYK, or HSV format)
  2. Click "Convert" or press Enter to see all color format conversions instantly
  3. Use the "Random Color" button for inspiration or testing
  4. Click any "Copy" button to copy that specific color format to clipboard
  5. View the live color preview and accessibility contrast ratios
  6. Use "Clear" to reset all inputs and start fresh

🌈 Color Systems Explained

HEX (Hexadecimal)

A 6-digit code starting with #, representing Red, Green, and Blue values in hexadecimal (00–FF). Example: #FF0000 is pure red.

RGB (Red, Green, Blue)

An additive color model where colors are created by combining red, green, and blue light. Values range from 0–255. Example: rgb(255, 0, 0) is pure red.

HSL (Hue, Saturation, Lightness)

Defined by Hue (0–360°), Saturation (0–100%), and Lightness (0–100%). It's more intuitive for color adjustments. Example: hsl(0, 100%, 50%) represents red.

HSV (Hue, Saturation, Value)

Similar to HSL but uses Value instead of Lightness. Often used in color pickers for digital design. Example: hsv(0, 100%, 100%) is bright red.

CMYK (Cyan, Magenta, Yellow, Key/Black)

A subtractive color model used in printing. Values range from 0–100% for each color channel. Example: cmyk(0%, 100%, 100%, 0%) represents red ink.

About the Color Code Converter

This tool converts a colour between the three formats used most in web and graphic design: HEX, RGB, and HSL. Enter a hex code such as #3b82f6 and instantly see its RGB and HSL equivalents, along with a live preview swatch of the colour itself.

The three colour formats

HEX writes a colour as a six-digit hexadecimal code, two digits each for red, green, and blue. RGB expresses the same three channels as decimal numbers from 0 to 255, which many people find more intuitive. HSL takes a different approach, describing a colour by its hue (its position on the colour wheel from 0 to 360 degrees), its saturation (how vivid it is), and its lightness (how bright). All three describe the same visible colours; they are just different coordinate systems for the same space.

Why each format is useful

HEX is compact and dominant in HTML and CSS, which is why it is everywhere on the web. RGB maps directly to how screens actually emit light, mixing red, green, and blue, and is handy when adjusting individual channels. HSL is the most human-friendly for designing: because hue, saturation, and lightness are separated, you can take a colour and easily make it lighter, more muted, or shift it around the wheel without guesswork. Designers often pick a colour in HSL precisely because creating harmonious variations is so much easier there.

How the conversion works

Converting HEX to RGB simply reads each pair of hex digits as a number from 0 to 255. Converting RGB to HSL involves finding the maximum and minimum channel values to derive lightness, then computing saturation and the hue angle from their relationships. The maths is well defined, so the conversions are exact, and seeing all three side by side helps you understand how a colour is constructed.

Common uses

Web developers convert between formats when a design tool gives one format but their code needs another. Designers use it to build palettes, find accessible contrast, and create tints and shades. Anyone matching a brand colour across tools that speak different formats will reach for a converter like this regularly.

Tips and related tools

The tool accepts hex codes with or without the leading hash, and supports both three-digit shorthand and full six-digit codes. The live swatch lets you confirm visually that you have the colour you intended. For a quick one-way HEX to RGB conversion see the HEX to RGB Converter, and to check colours for accessibility the Color Blindness Simulator. Everything runs in your browser.

Frequently Asked Questions

What input format?

A hex color like #3b82f6 or 3b82f6.

What does it output?

The equivalent RGB and HSL values.

Does it support alpha?

This version handles solid colors.

Three or six digits?

Six-digit hex is recommended; three-digit shorthand also works.

Where does the conversion run?

Entirely in your browser. Your data is never uploaded to a server.