Ankyrin repeats are an amino-acid motif believed to function in protein recognition; they are present in tandem copies in diverse proteins in nearly all phyla. Ankyrin repeats contain antiparallel alpha-helices that can stack to form a superhelical spiral. Visual inspection of the extrapolated structure of 24 ankyrin-R repeats indicates the possibility of spring-like behaviour of the putative superhelix. Moreover, stacks of 17-29 ankyrin repeats in the cytoplasmic domains of transient receptor potential (TRP) channels have been identified as candidates for a spring that gates mechanoreceptors in hair cells as well as in Drosophila bristles. Here we report that tandem ankyrin repeats exhibit tertiary-structure-based elasticity and behave as a linear and fully reversible spring in single-molecule measurements by atomic force microscopy. We also observe an unexpected ability of unfolded repeats to generate force during refolding, and report the first direct measurement of the refolding force of a protein domain. Thus, we show that one of the most common amino-acid motifs has spring properties that could be important in mechanotransduction and in the design of nanodevices.