designwithfocus

Color codes & color models

What Is the Blue Color Code? HEX, RGB, CMYK and HSL

By Design With Focus Team 8 min read
Row of blue paint swatches from light sky blue to deep navy on a white background

Short answer

The blue color code is #0000FF, which is rgb(0, 0, 255) in CSS. In CMYK it is 100% cyan, 100% magenta, 0% yellow and 0% black, and in HSL it is 240 degrees hue, 100% saturation and 50% lightness. The W3C defines "blue" as one of its named CSS colors, so you can type the word blue in a stylesheet and get the same #0000FF value. Use the table below to copy the code.

Last verified against the sources listed below.

Key takeaways

  • Blue is #0000FF, rgb(0, 0, 255), CMYK 100/100/0/0 and HSL 240, 100%, 50%.
  • Navy blue is #000080, royal blue is #4169E1, light blue is #ADD8E6 and baby blue is #89CFF0.
  • Blue text on a white background has a contrast ratio of 8.59:1, which passes WCAG AAA.
  • Light blues such as sky blue need dark text, because their contrast with white is under 2:1.
  • Baby blue is not a W3C named color; #89CFF0 is the widely used value for it.
  • CMYK and HSL values in the table are computed from the RGB values with the standard formulas.

Blue is one of the 16 basic colors in CSS, and its code is the same in every browser. This page lists the exact HEX, RGB, CMYK and HSL values for blue and the shades people search for most, so you can copy the code and use it right away.

The HEX and RGB values in the main table come from the W3C named color list in CSS Color Module Level 4. CMYK and HSL values are computed from those RGB values with the standard formulas, which keeps every row exact and repeatable.

What is the blue color code?

The blue color code is #0000FF, which is rgb(0, 0, 255). A HEX code is six hexadecimal digits after a hash sign: the first pair sets red, the second sets green and the third sets blue. For #0000FF the red and green pairs are 00, so the color is pure blue at full strength.

In CSS you can write the color three ways: the keyword “blue”, the HEX code #0000FF, or rgb(0, 0, 255). MDN lists the same three notations in its CSS color guide. All three give the same color in every browser, because the W3C defines the keyword “blue” as #0000FF. Use the keyword for short code, and the HEX code to paste into a design tool.

The Blue Color Code tool shows the same values with a picker, so you can copy #0000FF in one click and test nearby shades. It runs free in your browser with no sign-up.

Blue color code table: 15 shades with HEX, RGB, CMYK and HSL

The table below lists blue and 14 named blue shades with their HEX, RGB, CMYK and HSL values. Copy the row you need, and read the notes under the table before you send a file to print.

Shade HEX RGB CMYK HSL
Blue #0000FF 0, 0, 255 100, 100, 0, 0 240, 100%, 50%
Navy #000080 0, 0, 128 100, 100, 0, 50 240, 100%, 25%
Dark blue #00008B 0, 0, 139 100, 100, 0, 45 240, 100%, 27%
Medium blue #0000CD 0, 0, 205 100, 100, 0, 20 240, 100%, 40%
Royal blue #4169E1 65, 105, 225 71, 53, 0, 12 225, 73%, 57%
Midnight blue #191970 25, 25, 112 78, 78, 0, 56 240, 64%, 27%
Steel blue #4682B4 70, 130, 180 61, 28, 0, 29 207, 44%, 49%
Dodger blue #1E90FF 30, 144, 255 88, 44, 0, 0 210, 100%, 56%
Deep sky blue #00BFFF 0, 191, 255 100, 25, 0, 0 195, 100%, 50%
Sky blue #87CEEB 135, 206, 235 43, 12, 0, 8 197, 71%, 73%
Light sky blue #87CEFA 135, 206, 250 46, 18, 0, 2 203, 92%, 75%
Light blue #ADD8E6 173, 216, 230 25, 6, 0, 10 195, 53%, 79%
Powder blue #B0E0E6 176, 224, 230 23, 3, 0, 10 187, 52%, 80%
Cornflower blue #6495ED 100, 149, 237 58, 37, 0, 7 219, 79%, 66%
Baby blue #89CFF0 137, 207, 240 43, 14, 0, 6 199, 77%, 74%

Every row except baby blue is a W3C named color, taken from the CSS Color Module Level 4 named color table. Baby blue has no W3C name, so its row uses #89CFF0, the value Canva lists for it.

CMYK values here use the standard profile-free formula, so treat them as a starting point for print, not a press proof. To move between formats, the RGB to HEX converter turns any RGB triplet into its HEX code in one step.

Blue shade swatch grid showing 15 blue shades from navy to powder blue with HEX labels

Navy blue is #000080, royal blue is #4169E1, light blue is #ADD8E6 and baby blue is #89CFF0. Each one has its own page on this site with the full code set, and the four paragraphs below give you the short version.

Navy blue, #000080, is rgb(0, 0, 128): the same hue as blue at half the lightness. Use it for headers, footers and formal pages where pure blue feels too bright. The Navy Blue Color Code page lists its CMYK and HSL values too.

Royal blue, #4169E1, is rgb(65, 105, 225) with a hue of 225 degrees. It is lighter and softer than pure blue, so it works well for buttons and links that need to stand out without shouting. The Royal Blue Color Code page has the full set of values.

Light blue, #ADD8E6, is rgb(173, 216, 230). It reads as a background tint rather than a main color, so pair it with navy text instead of using it for text. The Light Blue Color Code page lists its CMYK and HSL values.

Baby blue, #89CFF0, is rgb(137, 207, 240). It has no W3C name, but Canva lists #89CFF0 as the baby blue hex code, with the same RGB and CMYK numbers this page uses. The Baby Blue Color Code page has the full set of values.

Color palettes that pair with blue

Blue pairs well with white, light gray, yellow and coral. White and light gray give it room to breathe, while yellow and coral sit warm against its cool tone, so the mix stays balanced instead of flat.

  • Ocean: #0000FF, #00BFFF, #87CEEB and #FFFFFF. Use the deep blue for headers, the two lighter blues for panels, and white for the page behind them.
  • Navy and gold: #000080, #FFD700, #C0C0C0 and #FFFFFF. Navy leads, gold marks the accent, silver softens dividers, and white keeps the page light.
  • Royal and coral: #4169E1, #FF7F50, #191970 and #FFFFFF. Coral buttons pop against a royal blue field, and midnight blue grounds the footer.
  • Sky and sand: #87CEEB, #F4A460, #4682B4 and #FFFFFF. Sky blue sets a light mood, sandy brown warms it up, and steel blue holds the text.

Where to use blue in design

Use blue for links, buttons, headers and page backgrounds where you want a calm and trusted feel. The W3C notes that traditional blue link text on white is highly legible, and readers already know blue text is clickable.

Save light blues for backgrounds and panels, and keep them away from small text. A pale blue fill with navy text reads well, while the same pale blue as text on white fades out. Dark blues work the other way: they hold large headings and buttons, but a full dark blue page can feel heavy, so break it up with white space.

Blue also fits charts and maps, where it can mark water, cold or low values without extra labels. Pair it with one warm accent instead of three more blues, or the page turns into a single wash of color with no focal point.

Blue and text contrast: what passes WCAG

Blue #0000FF text on a white background passes WCAG at AAA level with a ratio of 8.59:1, but the same blue on a black background fails at 2.44:1. The background matters as much as the color, so always check the pair, not the color alone.

The W3C gives both numbers in CSS Color Module Level 4, and WCAG 2.2 sets the bar: normal text needs at least 4.5:1 at level AA, large text needs 3:1, and level AAA raises normal text to 7:1.

Royal blue passes AA for normal text on white at 4.85:1, while steel blue at 4.11:1 does not, so a small change in shade can flip the result. Dodger blue at 3.24:1 passes only for large text, and deep sky blue at 2.12:1 needs dark text on a light fill instead.

Light blues fail with white text by a wide margin: sky blue is 1.74:1, light blue is 1.53:1 and powder blue is 1.43:1 against white. Put dark text on them instead: black on light blue reaches 13.74:1, and black on baby blue reaches 12.25:1, as the Colors Encyclopedia entry for baby blue also shows.

Frequently asked questions

What is the color code for blue?

The color code for blue is #0000FF in HEX, or rgb(0, 0, 255). In CMYK it is 100% cyan, 100% magenta, 0% yellow and 0% black, and in HSL it is 240 degrees hue, 100% saturation and 50% lightness. In CSS you can also write the keyword blue, which the W3C defines as the same #0000FF value.

What is the navy blue color code?

Navy blue is #000080, or rgb(0, 0, 128). It is the same hue as blue at half the lightness, which gives it a dark, formal look. Its CMYK values are 100% cyan, 100% magenta, 0% yellow and 50% black, and its HSL values are 240 degrees hue, 100% saturation and 25% lightness.

What is the royal blue color code?

Royal blue is #4169E1, or rgb(65, 105, 225). It is a W3C named color with a hue of 225 degrees, so it sits slightly toward violet from pure blue. Its CMYK values are 71% cyan, 53% magenta, 0% yellow and 12% black, and its HSL values are 225 degrees, 73% saturation and 57% lightness.

What is the light blue color code?

Light blue is #ADD8E6, or rgb(173, 216, 230). It is a W3C named color, and it works best as a background tint with dark text on top. Its CMYK values are 25% cyan, 6% magenta, 0% yellow and 10% black, and its HSL values are 195 degrees, 53% saturation and 79% lightness.

What is the baby blue color code?

Baby blue is #89CFF0, or rgb(137, 207, 240). It is not a W3C named color, so no official CSS keyword exists for it, but #89CFF0 is the value Canva lists for it. Its CMYK values are 43% cyan, 14% magenta, 0% yellow and 6% black, and its HSL values are 199 degrees, 77% saturation and 74% lightness.

What is the CMYK code for blue?

The CMYK code for blue is 100% cyan, 100% magenta, 0% yellow and 0% black, written as cmyk(100%, 100%, 0%, 0%). That mix comes from the standard profile-free formula applied to rgb(0, 0, 255). Treat it as a starting point for print, because a real press profile can shift the result.

Sources