The aim of the Kaczmarz algorithm is to reconstruct an element in a Hilbert space from data given by inner products of this element with a given sequence of vectors. The main result characterizes sequences of vectors leading to reconstruction of any element in the space. This generalizes some results of Kwapień and Mycielski.