Single-molecule localization microscopy techniques transcend the diffraction limit of visible light by localizing isolated emitters sampled stochastically. This time-lapse imaging necessitates long acquisition times, over which sample drift can become large relative to the localization precision. Here, we present an efficient and robust method for estimating drift, using a simple peak-finding algorithm based on mean shifts that is effective for single-molecule localization microscopy in two or three dimensions.