In a GIF palette table, color indices range from 0 to what number?

The story behind the answer

In a full GIF palette table, color indices range from 0 to 255.

GIF uses indexed color: pixels do not usually store complete red, green, and blue values directly. Instead, each pixel stores an index that points to an RGB color in a global or local color table. Because the index is at most 8 bits wide, a palette can contain up to 256 entries, numbered 0 through 255.

The endpoints are inclusive, so 0–255 represents 256 possible entries rather than 255. A particular image can use fewer colors, and GIF color tables may contain powers of two from 2 through 256 entries. In a smaller table, the usable index range is correspondingly smaller—for example, a 16-color table uses indices 0 through 15.

This limit was significant when GIF was designed, because many computers and display adapters commonly handled 256 colors. GIF’s palette restriction is also why photographs may show banding or speckled patterns after conversion. Dithering can make those limitations look smoother, but it does not increase the actual number of palette entries.

Source: Wikipedia · fact-checked Sept. 2026

Add question to a list

Choose a list to keep this question in: