In JPEG image compression algorithms, an entropy coder encodes an end-of-block (EOB) marker for each discrete cosine transform (DCT) block. The well-known Huffman coder encodes one such marker for each block. However, the binary arithmetic coder, which provides greater compression but is not as well known, encodes several EOB tests, one after each nonzero ac coefficient of the block. We present a modification to the JPEG arithmetic coding algorithm to reduce the number of EOB tests. Our algorithm encodes two extra zero ac coefficients for a small percentage of blocks, but it encodes fewer EOB tests. As a result, we reduce the total image code size by about 1.4% on average. In this process, we also study the effectiveness of the DCT and statistical models of this coder.