One of the key challenges for future electronic memory and logic devices is finding viable ways of moving from today’s two-dimensional structures, which hold data in an x–y mesh of cells, to three-dimensional structures in which data are stored in an x–y–z lattice of cells. This could allow a many-fold increase in performance. A suggested solution is the shift register1,2—a digital building block that passes data from cell to cell along a chain. In conventional digital microelectronics, two-dimensional shift registers are routinely constructed from a number of connected transistors. However, for three-dimensional devices the added process complexity and space needed for such transistors would largely cancel out the benefits of moving into the third dimension. ‘Physical’ shift registers, in which an intrinsic physical phenomenon is used to move data near-atomic distances, without requiring conventional transistors, are therefore much preferred. Here we demonstrate a way of implementing a spintronic unidirectional vertical shift register between perpendicularly magnetized ferromagnets of subnanometre thickness, similar to the layers used in non-volatile magnetic random-access memory3. By carefully controlling the thickness of each magnetic layer and the exchange coupling between the layers, we form a ratchet that allows information in the form of a sharp magnetic kink soliton to be unidirectionally pumped (or ‘shifted’) from one magnetic layer to another. This simple and efficient shift-register concept suggests a route to the creation of three-dimensional microchips for memory and logic applications.