Color Converter

Convert any color between HEX, RGB and HSL instantly — pick, preview and copy in one place.

Runs in your browserUpdated Built and maintained by Leon and Henrik

Pick a color and read it instantly as HEX, RGB and HSL — copy whichever format you need. Free. No sign-up. Runs in your browser, nothing is uploaded.

Color Converter
#3B82F6closest: royalblue
HEX#3B82F6
RGBrgb(59, 130, 246)
HSLhsl(217, 91%, 60%)
HSVhsv(217, 76%, 96%)
CMYKcmyk(76%, 47%, 0%, 4%)

Shades & tints

Contrast & accessibility

  • On white (#FFFFFF)3.68 : 1 · AA (large text only)
  • On black (#000000)5.71 : 1 · AA

WCAG asks for at least 4.5 : 1 for normal text (AA) and 7 : 1 for AAA; large text passes AA from 3 : 1. Use black text on this background.

Complementary color

The opposite hue is #F6AF3C. Paired with #3B82F6 it gives the strongest contrast on the color wheel — good for accents, risky for large areas.

Runs in your browser
Nothing is uploaded

Type a HEX code, an rgb() or hsl() value or a CSS color name, or use the picker, and the converter shows that color as HEX, RGB, HSL, HSV and CMYK with a copy button on each row. Below that you get an 11-step scale of tints and shades, the contrast against white and black, and the complementary color. Clicking any swatch makes it the active color.

One color through every format: #3B82F6

FormatValueWhat the numbers mean
HEX#3B82F6red, green, blue as two hex digits each
RGBrgb(59, 130, 246)each channel 0–255
HSLhsl(217, 91%, 60%)hue angle, saturation, lightness
HSVhsv(217, 76%, 96%)hue angle, saturation, value (brightness)
CMYKcmyk(76%, 47%, 0%, 4%)cyan, magenta, yellow, black ink

How the converter gets there:

  • HEX → RGB: each pair is a base-16 number. 3B = 3 × 16 + 11 = 59, 82 = 8 × 16 + 2 = 130, F6 = 15 × 16 + 6 = 246.
  • RGB → HSL: scale the channels to 0–1 (0.231, 0.510, 0.965). Lightness is the average of the largest and smallest: (0.965 + 0.231) ÷ 2 = 0.598 → 60%. Saturation is their difference divided by 1 − |2L − 1|: 0.733 ÷ 0.804 = 91%. Blue is the largest channel, so the hue sits in the blue sector: 60 × ((R − G) ÷ difference + 4) = 217°.
  • RGB → CMYK: K = 1 − largest channel = 1 − 0.965 = 4%. Each ink is then (1 − channel − K) ÷ (1 − K): cyan = (1 − 0.231 − 0.035) ÷ 0.965 = 76%, magenta 47%, yellow 0%.

The complementary color rotates the hue by 180°: 217° + 180° = 37°, an orange with the same saturation and lightness.

HSL vs. HSV: same hue, different numbers

Both start with the same hue angle but describe the rest differently, which is why pasting values between tools goes wrong so often:

  • HSL lightness: 0% is black, 100% is white, and the pure, fully saturated color sits at 50%.
  • HSV value (also called HSB brightness, the model in Photoshop's and Figma's pickers): 0% is black, and the pure color sits at 100%.

So pure red is hsl(0, 100%, 50%) but hsv(0, 100%, 100%). CSS understands hsl() only; HSV is for design apps. When a designer hands you "HSB 217, 76, 96", it's the HSV row you need to match, and the HSL row is what goes into your stylesheet.

Which format to copy for which job

  • HEX for stylesheets, design tokens and brand guides. It's compact and every tool accepts it.
  • RGB when you work with channels: image processing, canvas code, or adding transparency with rgb(59 130 246 / 50%).
  • HSL when you want to adjust a color in code: keep hue and saturation and step the lightness for hover and active states.
  • HSV to match a value from a design app's color picker.
  • CMYK as a rough guide for print, never as the final number (see the FAQ).

The shade scale and the contrast check

The Shades & tints row keeps hue and saturation fixed and steps the HSL lightness: five lighter tints toward near-white, your color in the middle, five darker shades toward near-black. It's a quick way to find a hover color or a light background in the same family. For a full design-system scale with named steps, the Color Shade Generator goes further, and for five colors that work together as a scheme, the Color Palette Generator.

Contrast & accessibility shows the WCAG ratio of your color against white and black. If neither reaches 4.5:1, don't put normal-size text on it. Check the exact pair with the Color Contrast Checker.

Mistakes when moving colors between tools

  • The missing #. color: 3b82f6 is invalid CSS; it needs the #. The HEX row always includes it.
  • Shortening the wrong code. #38f expands to #3388FF, so only codes made of doubled digits have a three-digit form. #3B82F6 can't be shortened; #3b8 is a different color entirely.
  • Percent vs. 0–255. rgb(50%, 0%, 0%) is rgb(128, 0, 0), not rgb(50, 0, 0). Both forms are accepted here; check which one a value was written in before you copy the numbers somewhere else.
  • Lost transparency. An rgba() or hsla() alpha value is ignored here, and an 8-digit HEX like #3B82F680 isn't accepted. Add the alpha back after converting.
  • Expecting a lossless HSL round trip. Treat the rounded HSL as a label, and keep the HEX as the source of truth.

Common CSS named colors

These are the colors people look up most often. Paste any of them into the converter above to see the other formats, the shade scale, the complementary partner and whether black or white text passes WCAG on it.

NameHEXRGB
red#FF0000rgb(255, 0, 0)
orange#FFA500rgb(255, 165, 0)
gold#FFD700rgb(255, 215, 0)
yellow#FFFF00rgb(255, 255, 0)
lime#00FF00rgb(0, 255, 0)
green#008000rgb(0, 128, 0)
teal#008080rgb(0, 128, 128)
cyan / aqua#00FFFFrgb(0, 255, 255)
skyblue#87CEEBrgb(135, 206, 235)
blue#0000FFrgb(0, 0, 255)
navy#000080rgb(0, 0, 128)
indigo#4B0082rgb(75, 0, 130)
purple#800080rgb(128, 0, 128)
magenta / fuchsia#FF00FFrgb(255, 0, 255)
crimson#DC143Crgb(220, 20, 60)
pink#FFC0CBrgb(255, 192, 203)
brown#A52A2Argb(165, 42, 42)
chocolate#D2691Ergb(210, 105, 30)
beige#F5F5DCrgb(245, 245, 220)
ivory#FFFFF0rgb(255, 255, 240)
silver#C0C0C0rgb(192, 192, 192)
gray#808080rgb(128, 128, 128)
black#000000rgb(0, 0, 0)
white#FFFFFFrgb(255, 255, 255)

Two rows are the same color under two names: cyan and aqua are both #00FFFF, magenta and fuchsia are both #FF00FF. CSS accepts either spelling; pick one and stay consistent inside a codebase.

The bigger trap is that named colors are convenient but imprecise. CSS green is #008000, not the bright #00FF00 most people picture; that one is lime. If a design brief says "green", ask for the HEX before you ship it. For a color that isn't in this list, the Named Color Finder tells you the closest CSS name.

Frequently asked questions

Related tools

All Color tools →