How Hex color codes work
A six-digit Hex value uses two characters for red, two for green, and two for blue. Each channel ranges from 00 to FF, giving the same color range as RGB values from 0 to 255.
Three-digit Hex colors
Some colors can be written in shorthand. For example, #fff expands to #ffffff and #09c expands to #0099cc. Shorthand is compact, but six-digit Hex values are clearer for design systems.
Converting Hex colors
Hex and RGB describe the same screen channels. Converting between them does not change the color; it only changes how the value is written.
Related color tools
Use these tools to pick, convert, test, and export the color values described in this guide.
More color guides
Color GuidesPractical guides for HTML color codes, Hex values, RGB, HSL, CSS colors, palettes, web safe colors, and shades.HTML Color CodesLearn how HTML color codes work and copy Hex, RGB, HSL, OKLCH, named colors, and CSS-ready color values.RGB Color CodesUnderstand RGB color codes, convert RGB to Hex, and use rgb() values in CSS.HSL Color CodesLearn HSL color codes, hue angles, saturation, lightness, and how to use hsl() in CSS.CSS Color CodesUse CSS color codes in stylesheets, gradients, borders, shadows, SVG, and interface design.Color Palette GeneratorGenerate color palettes from a base color, image, color wheel, harmony, shades, tints, and tones.Web Safe ColorsExplore web safe colors, classic browser-safe palettes, Hex values, and modern alternatives.Color Shades GeneratorCreate color shades, tints, tones, and variations from any Hex, RGB, HSL, or OKLCH color.