The reduction of experimental data to histograms is often useful, particularly if the experimental site is remote (e.g., in a spacecraft). An implementation utilizing prefix coding is described which permits assembling an

-sample,

-cell histogram directly from sequentially received data with minimal logic and memory requirements. The necessary storage is shown to differ from the minimum number of bits required for unique specification of an (

) histogram by less than

when

. The method codes the contents, denoted by

, of a cell into a binary code word of length

. A minimax theorem is presented to justify selecting

from a class of linear staircase functions, and the best such function satisfying the Kraft inequality is determined. Graphs are presented of the resulting storage requirements.