Netscape Application Block Byte Signature in GIFs

This article provides an exact breakdown of the Netscape Application Extension block byte signature used to loop animated GIF files. While the original GIF89a specification did not natively define animation looping, Netscape Navigator 2.0 introduced a standard application extension block that image viewers still recognize today. Below is the precise byte sequence, hex values, and structure used to implement this feature.

The Application Extension Signature

An Application Extension in a GIF begins with a standard 3-byte prefix indicating an application-specific block, immediately followed by the 11-byte Netscape application signature (NETSCAPE2.0).

In hexadecimal notation, the complete 14-byte signature header is:

21 FF 0B 4E 45 54 53 43 41 50 45 32 2E 30

Byte-by-Byte Breakdown

  • 0x21: Extension Introducer, identifying the start of a GIF extension block.
  • 0xFF: Application Extension Label, specifying that this block contains application-specific data.
  • 0x0B: Block Size indicator (11 bytes in decimal), defining the length of the identifier and authentication code that follow.
  • 0x4E 0x45 0x54 0x53 0x43 0x41 0x50 0x45: Application Identifier string "NETSCAPE" represented in ASCII (8 bytes).
  • 0x32 0x2E 0x30: Application Authentication Code string "2.0" represented in ASCII (3 bytes).

The Complete Loop Control Block

To fully define animation looping, the signature is immediately followed by a sub-block containing the iteration parameters:

03 01 xx xx 00

  • 0x03: Sub-block size (3 bytes of payload).
  • 0x01: Sub-block ID (specifying the loop sub-block).
  • xx xx: Unsigned 16-bit little-endian integer determining the loop count. A value of 00 00 represents infinite looping, whereas 01 00 loops once, 02 00 loops twice, and so on.
  • 0x00: Block Terminator, signaling the end of the Application Extension.

When combined for an infinitely looping GIF, the entire 19-byte sequence reads:

21 FF 0B 4E 45 54 53 43 41 50 45 32 2E 30 03 01 00 00 00