We tested the hypothesis that aspects of the neural code of retinal ganglion cells are optimized to transmit visual information at minimal metabolic cost. Under a broad ensemble of light patterns, ganglion cell spike trains consisted of sparse, precise bursts of spikes. These bursts were viewed as independent neural symbols. The noise in each burst was measured via repeated presentation of the visual stimulus, and the energy cost was estimated from the total charge flow during ganglion cell spiking. Given these costs and noise, the theory of efficient codes predicts an optimal distribution of symbol usage. Symbols that are either noisy or costly occur less frequently in this optimal code. We found good qualitative and quantitative agreement with the measured distribution of burst sizes for ganglion cells in the tiger salamander retina.