hardware-accurate retro display colors

CGA color codes (hex)

All 16 CGA color codes — hex, RGB, decimal, and palette index — in one clean, copyable reference. Hardware-accurate, including the real brown at index 6. Click any value to copy, or export the whole set.

Hex, RGB & decimal table

#namehexRGBdecimal
Index 6 is brown #AA5500, not dark yellow. The IBM 5153 monitor halves the green component for this one color. Toggle the button above to see the clone-monitor dark-yellow #AAAA00 variant instead — a distinction most "CGA hex code" lists get wrong.

About the CGA color codes

CGA's 16 colors come from a 4-bit RGBI signal: red, green, blue, and an intensity bit. The eight "low" colors put each active channel at 0xAA (170); the intensity bit lifts every channel by 0x55 (85), giving the eight "high" colors. That's why, for example, dark gray is #555555 and white is #FFFFFF. The only exception is color 6 (brown), explained above.

These same 16 codes are the default palette for EGA and VGA too, kept for backward compatibility. For the graphics-mode color sets and an interactive view, see the full CGA palette page and the CGA mode simulator; for the composite-TV artifact colors (which are not these codes), see CGA composite colors.

Frequently asked

What's the hex code for each CGA color?
Black 000000, blue 0000AA, green 00AA00, cyan 00AAAA, red AA0000, magenta AA00AA, brown AA5500, light gray AAAAAA, dark gray 555555, light blue 5555FF, light green 55FF55, light cyan 55FFFF, light red FF5555, light magenta FF55FF, yellow FFFF55, white FFFFFF.
Can I copy these into my code?
Yes — click any swatch or value to copy a single code, or use the export buttons for CSS variables, JSON, a GIMP palette, or a plain hex list.
Why do some charts show AAAA00 for brown?
That's the math-derived dark yellow, what clone monitors without the brown-correction circuit displayed. On a genuine IBM 5153 it's #AA5500.