Skip to main content
Sunday
Glossary/Hex code

What is Hex code?

A hex code is the six-digit value that defines an exact color on screens. Learn how it works and how it fits into brand and merch color workflows.

See your brand on merch

Create a free account to preview your branding across 500+ products with live pricing. No commitment required.

Get started

Definition

A hex code is a six-character value, like #1A73E8, that tells a screen exactly which color to display. It is the standard way to define color on the web and in design tools, which is why most brand guides list a hex code for every brand color.

Definition

A hex code is a hexadecimal way of writing an RGB color. The six characters split into three pairs, one each for red, green, and blue, from 00 to FF. So #FF0000 is pure red and #000000 is black. For example, a brand might set #0B5FFF as its primary blue, and every website, app, and slide uses that exact value to stay consistent on screen.

How a hex code works

Each pair of characters is a number from 0 to 255 written in base 16. The first pair sets red, the second green, the third blue. Mixing these three light channels at different strengths produces every on-screen color, which is the RGB model. Because it is light-based and additive, more of each channel moves toward white, not black.

Hex codes are precise and universal on screens, so a developer, a designer, and a slide template all render #0B5FFF identically. That makes hex the natural home for digital brand color. The shorthand also travels well, since one short string carries the full color with no ambiguity.

The catch is that hex describes light, not ink. A screen color does not automatically print the same way, because print uses CMYK or spot inks with a different and smaller range. A hex code is the starting point for digital, but for physical merch it usually needs a matching CMYK build or a Pantone reference so the printed color stays true.

Hex code in branded merch

  1. Anchor your digital brand color. Set a hex code for every brand color so web, app, and email stay identical.
  2. Bridge to print values. Pair each hex with a CMYK and Pantone equivalent so screen and product colors line up.
  3. Brief mockups accurately. Share the hex for on-screen previews and proofs, then confirm the print reference before production.

A hex code is a six-digit code that specifies an exact color for screens using red, green, and blue values.

5 tips to elevate your Hex code strategy

TipSteps
Store all threeKeep hex, CMYK, and Pantone together in your brand guide
Use full six digitsWrite the complete code to avoid shorthand ambiguity
Do not print by hexConvert to CMYK or Pantone for any physical product
Check contrastTest hex pairs for readable text and accessibility
Keep one sourceDefine each brand color once so values never drift

Key Terminologies

CMYK - the four-ink process model used for full-color printing.
Pantone color chart - the spot-color swatch system for exact, pre-mixed inks.
Pantone to CMYK - converting a spot Pantone color into a four-color print mix.
RGB - the red, green, and blue light model that hex codes represent.

Frequently Asked Questions

What does a hex code represent?

A hex code represents an RGB color as six characters, with two each for red, green, and blue. It tells a screen the exact mix of light to display.

Why does a hex code start with a hash symbol?

The hash sign marks the value as a hex color in code and design tools. The six characters after it carry the actual red, green, and blue values.

Can I print directly from a hex code?

Not reliably. Hex describes screen light in RGB, while print uses CMYK or spot inks, so you should convert the hex to a print value first.

Is a hex code the same as RGB?

They describe the same color in different formats. A hex code is a compact way of writing the same red, green, and blue values that RGB lists as numbers.

How do I match a hex code to a Pantone color?

Use a conversion tool or Pantone's bridge values to find the nearest spot color, then confirm with a physical chip, since screen and ink ranges differ.

Try Sunday

Instantly preview your brand across 500+ products

Create your free account and access our complete catalog in your branding with live pricing in 30 seconds.

Explore freely
Order when you're ready
Get started

Designs in 30 seconds · Free account · No credit card required

What is a hex code? - Glossary | Sunday