Color Code Converter

Convert colors between HEX, RGB, HSL, HSV, and CMYK formats instantly. Includes live preview, shades generator, and CSS snippets.

#3B82F6

Formats

HEX
RGB
HSL
°
%
%
HSV
°
%
%
CMYK
Recent:

CSS Snippets

Background
background-color: #3B82F6;
Text Color
color: rgb(59, 130, 246);
Border
border: 2px solid #3B82F6;
Box Shadow
box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
Linear Gradient
background: linear-gradient(135deg, #3B82F6, hsl(217, 91%, 60%));

Shades & Tints

Click any swatch to load into converter

Color Harmony

complementary

triadic

analogous

split Complementary

Colors in digital design exist in many different formats — and switching between them manually is tedious and error-prone. Whether you are a frontend developer converting a designer's HEX code into HSL for CSS manipulation, a print designer converting screen colors to CMYK for accurate printing, or simply trying to find the perfect complementary color for your palette — this free online color converter handles it all instantly. Enter any color in any format and get the equivalent values in HEX, RGB, HSL, HSV, and CMYK simultaneously, with a live preview, ready-to-use CSS snippets, shades and tints, and color harmony suggestions — all in one place.

How to Convert a Color

  • Enter your color using the color picker, by typing a HEX code, or by entering RGB or HSL values directly
  • All five color formats update instantly — HEX, RGB, HSL, HSV, and CMYK shown simultaneously
  • Click the Copy button next to any format to copy that value to your clipboard
  • Use the CSS Snippets section to get ready-to-use CSS code for your color
  • Explore the Shades and Tints panel to generate a full color scale

Color Format Reference

  • HEX — The most common format in web development. A six-character hexadecimal code prefixed with `#`. Each pair of characters represents Red, Green, and Blue values from `00` to `FF`. Example: `#3B82F6`.
  • RGB — Red, Green, Blue. Each channel ranges from 0 to 255. The native format for screen display. CSS syntax: `rgb(59, 130, 246)`. Also supports `rgba()` with an alpha channel for transparency.
  • HSL — Hue, Saturation, Lightness. Hue is the color angle (0–360°), Saturation is color intensity (0–100%), Lightness is brightness (0–100%). CSS syntax: `hsl(217, 91%, 60%)`. Preferred for programmatic color manipulation because changing lightness predictably lightens or darkens the color.
  • HSV / HSB — Hue, Saturation, Value (also called Brightness). Similar to HSL but uses Value instead of Lightness. Commonly used in color picker interfaces and design tools like Photoshop and Figma.
  • CMYK — Cyan, Magenta, Yellow, Key (Black). The standard format for print design. Values range from 0–100%. CMYK colors may look different from their RGB equivalents on screen because printers and screens handle color differently.

When to Use Each Color Format

  • Use HEX for web development — it is compact, universally supported, and the standard in CSS, HTML, and design tools.
  • Use RGB when you need to manipulate individual color channels or add transparency with `rgba()`.
  • Use HSL in CSS when you want to programmatically adjust colors — lightening, darkening, or creating color scales.
  • Use HSV when working with design tools like Photoshop, Illustrator, or Figma which use HSB pickers.
  • Use CMYK when preparing files for professional printing — always convert your screen colors to CMYK before sending to print.

Key Features

  • Instant conversion between HEX, RGB, HSL, HSV, and CMYK.
  • Native color picker integration.
  • Live color preview with automatic contrast text color.
  • CSS color name detection (if color matches a named CSS color).
  • Ready-to-use CSS code snippets for all common properties.
  • Shades and tints generator with 10-color palette.
  • Color harmony calculator (complementary, triadic, analogous, split-complementary).
  • CSS Named Colors browser with search.
  • Recent colors history.
  • Works on all devices including mobile.
  • 100% free — no signup, no account, no data uploaded.

Trust and Privacy Notice

All color conversion happens entirely in your browser. No color data is ever sent to any server. Your inputs remain 100% private and secure locally.

Frequently Asked Questions

How do I convert HEX to RGB?

Enter your HEX color code in the HEX field and the RGB values appear instantly. You can also use the color picker to select any color and all formats including RGB update automatically.

What is the difference between RGB and HSL?

RGB describes color using Red, Green, and Blue channel values from 0 to 255. HSL describes color using Hue (the color angle 0-360), Saturation (color intensity 0-100%), and Lightness (brightness 0-100%). HSL is more intuitive for humans to work with when adjusting colors.

When should I use CMYK vs RGB?

Use RGB for digital screens and web design. Use CMYK for print design. RGB is additive color mixing starting from black, while CMYK is subtractive starting from white. Colors look different in CMYK than RGB, so always convert correctly when preparing files for print.

What is HSV color format?

HSV (Hue, Saturation, Value) is also called HSB (Hue, Saturation, Brightness). It represents colors using the same Hue angle as HSL but uses Value (brightness) instead of Lightness. HSV is commonly used in color picker interfaces and image editing software.

How do I find the complementary color of a HEX code?

Enter your HEX code and scroll to the Color Harmony section. The complementary color is shown automatically — it is the color 180 degrees opposite on the color wheel. Click the swatch to load the complementary color into the converter.

Can I generate color shades and tints?

Yes. The Shades and Tints section shows 10 color swatches — 5 progressively darker shades and 5 progressively lighter tints of your color. Click any swatch to load it into the converter and see its values in all formats.

Is this color converter free?

Yes, completely free with no account or signup required. All color conversion happens entirely in your browser. No data is ever sent to any server.

Can I get CSS code for my color?

Yes. The CSS Code Snippets section shows ready-to-use CSS for background-color, color, border, box-shadow, and linear-gradient using your current color in HEX, RGB, and HSL formats. Each snippet has its own copy button.