Skip to content
hexcolorcodepicker.com
en

Hex Color Code Picker

Recent colors

Colors you pick will appear here.

    Chosen color

    #3B82F6

    Nearest CSS color: dodgerblue (#1E90FF)

    • HEX#3B82F6
    • RGBrgb(59, 130, 246)
    • HSLhsl(217, 91%, 60%)
    • HSVhsv(217°, 76%, 96%)
    • CMYKcmyk(76%, 47%, 0%, 4%)
    • OKLCHoklch(0.62 0.19 260)

    White text

    Sample text on this color

    3.68:1 · Fail AA normal

    Black text

    Sample text on this color

    5.71:1 · Pass AA normal

    Pick a color, copy its code

    Pick a color and the whole page follows it: the big swatch, all six codes, the palette strip, the shades strip, and the contrast check all update at once. The square, the hue slider, the opacity slider, and the HEX field are one picker, and one click copies HEX, RGB, HSL, HSV, CMYK, or OKLCH.

    The default color is #3B82F6, a bright blue: rgb(59, 130, 246) and hsl(217, 91%, 60%). The page accent is that blue right now — buttons, links, and highlights wear it — and it changes the second you pick a new color. Beside the picker, the big swatch shows #3B82F6 large, its HEX code big beside it, plus a live palette strip, a live shades strip, and sample text on the blue with the AA verdict for white and for black.

    Drag the dot across the square to change saturation and brightness, slide hue from 0 to 360 degrees, and slide opacity from 0 to 100 percent. Your last 16 colors stay in the recent strip, so a color you used five minutes ago is one click away. The Random button picks a new color from all 16,777,216 HEX colors.

    Try it: Drag the dot and watch the swatch, the codes, the palette, the shades, and the accent color change together.

    One color, every format

    One color has six codes on this site: HEX, RGB, HSL, HSV, CMYK, and OKLCH. They all describe the same color, so picking a new color updates all six at once. HEX is the code websites use most, and HSL is the easiest to adjust by hand.

    Take #3B82F6, the blue above. In RGB it is rgb(59, 130, 246): 59 red, 130 green, 246 blue, each from 0 to 255. In HSL it is hsl(217, 91%, 60%): hue 217 degrees, 91 percent saturation, 60 percent lightness. In HSV it is hsv(217 degrees, 76%, 96%), and in CMYK it is cmyk(76%, 47%, 0%, 4%). CMYK is always approximate, because printers and screens mix color in different ways.

    HSV and OKLCH cover the gaps the first three formats leave. HSV matches the picker square: hue across, saturation and value down. OKLCH is the modern format that keeps colors looking evenly bright as you change hue, which HSL does not.

    Try it: Type #FF5733 in the picker's HEX field and watch all six formats update.

    • HEX#3B82F6
    • RGBrgb(59, 130, 246)
    • HSLhsl(217, 91%, 60%)
    • HSVhsv(217°, 76%, 96%)
    • CMYKcmyk(76%, 47%, 0%, 4%)
    • OKLCHoklch(0.62 0.19 260)

    CMYK is always approximate — printers and screens mix color in different ways.

    Pick a color from a photo or screenshot

    Upload any image and click any pixel to read its HEX code. The image never leaves your browser, and a magnifier shows the exact pixel before you click. Your last 16 picks stay in a history strip, so you can compare them side by side.

    This is the fastest way to match a color you can see but cannot name. Drop in a logo, a photo, or a screenshot, zoom in with the magnifier, and click the pixel you want. The picker reads its HEX, RGB, and HSL codes at once. Photos of printed things and compressed screenshots give near-identical codes, not exact ones, so check the swatch before you ship it.

    Try it: Upload a photo and click a pixel under the magnifier to read its HEX code.

    Sample photo — click any pixel to read its color. To upload your own image, use the image picker.

    Sampled color

    Click a pixel above to sample its color.

    Sampled colors

      Build a palette from one color

      One color makes a whole palette: complementary, analogous, triadic, split-complementary, tetradic, or monochromatic. Pick a harmony type and the tool lays out five colors that work together. Click any swatch to make it the new base color and rebuild the palette around it.

      Complementary pairs sit opposite each other on the color wheel, 180 degrees apart, and give the strongest contrast. Analogous colors sit side by side and feel calm. Triadic palettes use three colors spaced 120 degrees apart. A good website palette has 3 to 5 colors: one main color, one or two accents, and one or two neutrals for text and backgrounds.

      Try it: Pick a harmony type and watch five swatches appear around #3B82F6.

      Color wheel — Build a palette from one color. Click a swatch to make it the new base color.

      Shades and tints of one color

      A shade is your color mixed with black, and a tint is your color mixed with white. This tool builds 10 lighter steps and 10 darker steps from any color, so you get a full scale for hover states, borders, and backgrounds from a single base color.

      Pick #3B82F6 and the scale runs from near-white tints down to near-black shades, each step labeled with its HEX code. Use a light tint for a card background, the base color for a button, and a darker shade for the button on hover. That one scale keeps a whole page consistent without guessing a new color for every state.

      Try it: Slide from the lightest tint to the darkest shade of #3B82F6 and copy any step.

      Click a swatch to copy its HEX code.

      Check contrast before you use a color for text

      Text is readable when its contrast ratio is at least 4.5:1 for normal text and 3:1 for large text. That is the WCAG AA standard. AAA needs 7:1 for normal text. Pick any text and background color to get the ratio and a pass or fail.

      White text on #3B82F6 scores 3.68:1, so it passes AA for large text but fails for normal text. Black text on the same blue scores 5.71:1 and passes AA for normal text. White on red scores 4.00:1, and white on yellow scores only 1.07:1 — yellow needs dark text. Black on yellow scores 19.56:1.

      Large text means 18 point or larger, or 14 point bold or larger. Everything smaller is normal text and needs the full 4.5:1. When a pair fails, darken the text or lighten the background until the ratio passes — small shifts often fix it.

      Try it: Pick a text color and a background color and read the ratio with its AA and AAA badges.

      White text · Normal text

      The quick brown fox jumps over the lazy dog

      3.68:1

      • AA normal: Fail
      • AA large: Pass
      • AAA normal: Fail
      • AAA large: Fail

      Black text · Large text

      The quick brown fox jumps over the lazy dog

      5.71:1

      • AA normal: Pass
      • AA large: Pass
      • AAA normal: Fail
      • AAA large: Pass

      HEX vs RGB vs HSL in one minute

      HEX, RGB, and HSL are three ways to write the same color. HEX packs the red, green, and blue values into six digits, RGB lists the same three numbers from 0 to 255, and HSL describes the color by hue, saturation, and lightness instead.

      Use HEX in CSS and HTML, because it is short and every browser reads it. Use RGB when code or a design tool hands you three numbers, or when you need an alpha channel as RGBA. Use HSL when you want to adjust a color: raise lightness for a tint, lower it for a shade, and shift hue to move around the wheel. One color, three notations, all in sync.

      The table on this page shows all six formats for #3B82F6 side by side, so you can compare them without converting anything by hand. Pick the row that matches your job, copy its value, and paste it where the color belongs.

      Try it: Read the table and find which format fits your job.

      FormatExampleRangeBest use
      HEX#3B82F6#RRGGBB — 6 digitsCSS and HTML
      RGBrgb(59, 130, 246)0–255 per channelCode or a design tool, or RGBA for transparency
      HSLhsl(217, 91%, 60%)0–360°, 0–100%, 0–100%Adjusting a color by hand
      HSVhsv(217°, 76%, 96%)0–360°, 0–100%, 0–100%The picker square
      CMYKcmyk(76%, 47%, 0%, 4%)0–100% per channelPrint — always approximate
      OKLCHoklch(0.62 0.19 260)Lightness 0–1, hue 0–360°Even brightness across hues
      #3B82F6

      How to use HEX codes in CSS and HTML

      Paste the HEX code after a # in your CSS, and the browser paints that exact color. Write color: #3B82F6; for text, background-color: #3B82F6; for a background, and border-color: #3B82F6; for a border. The same code works in HTML style attributes and in design tools like Figma and Canva.

      Name colors by role, not by value, so your code stays readable: --brand: #3B82F6; in a CSS custom property, then color: var(--brand); wherever the brand color belongs. Shorthand works when each pair repeats: #3B82F6 has no shorthand, but #FF0000 shortens to #F00 and #FFFFFF shortens to #FFF. Add two digits at the end for transparency: #3B82F680 is the same blue at about 50 percent opacity.

      Try it: Copy the CSS snippet and paste it into your own stylesheet.

      color: #3B82F6;
      background-color: #3B82F6;
      border-color: #3B82F6;
      --brand: #3B82F6;

      Sample text on your color

      color: #3B82F6;

      All color tools

      Color guides

      Find the right color tool

      21 tools, one topic — see About Hex Color Code Picker for who built this site.

      Frequently asked questions

      A HEX color code is six digits after a #, like #3B82F6, that tell a browser how much red, green, and blue to mix. Each pair is one channel, from 00 to FF. Six digits give 16,777,216 colors.