Important questions in neuroscience, such as how neural activity represents the sensory world, can be framed in terms of the extent to which spike trains differ from one another. Since spike trains can be considered to be sequences of stereotyped events, it is natural to focus on ways to quantify differences between event sequences, known as spike-train metrics. We begin by defining several families of these metrics, including metrics based on spike times, on interspike intervals, and on vector-space embedding. We show how these metrics can be applied to single-neuron and multineuronal data and then describe algorithms that calculate these metrics efficiently. Finally, we discuss analytical procedures based on these metrics, including methods for quantifying variability among spike trains, for constructing perceptual spaces, for calculating information-theoretic quantities, and for identifying candidate features of neural codes.