Large-field movements in the visual surround trigger spontaneous, compensatory eye movements known as optokinetic response (OKR) in all vertebrates. In zebrafish (Danio rerio) the OKR is well developed at 5 days post fertilization and can be used in the laboratory for screening of visual performance following genetic manipulations or pharmaceutical treatments. Several setups for measurement of the zebrafish OKR have been described. All of them are based on the presentation of moving gratings to the larva or to the adult fish. However, they differ in the way of presenting gratings and in the method of analysis. Here, we describe a detailed protocol for our newest software that enables computer-generation of the moving stripes and automatic tracking of eye movement. This protocol makes it possible to quantitatively measure OKR in both larvae and adult fishes in a fast and reliable way.