The proliferation and ubiquity of temporal data across many disciplines has generated substantial interest in the analysis and mining of time series. Clustering is one of the most popular data-mining methods, not only due to its exploratory power but also because it is often a preprocessing step or subroutine for other techniques. In this article, we present k -Shape and k -MultiShapes ( k -MS), two novel algorithms for time-series clustering. k -Shape and k -MS rely on a scalable iterative refinement procedure. As their distance measure, k -Shape and k -MS use shape-based distance (SBD), a normalized version of the cross-correlation measure, to consider the shapes of time series while comparing them. Based on the properties of SBD, we develop two new methods, namely ShapeExtraction (SE) and MultiShapesExtraction (MSE), to compute cluster centroids that are used in every iteration to update the assignment of time series to clusters. k -Shape relies on SE to compute a single centroid per cluster based on all time series in each cluster. In contrast, k -MS relies on MSE to compute multiple centroids per cluster to account for the proximity and spatial distribution of time series in each cluster. To demonstrate the robustness of SBD, k -Shape, and k -MS, we perform an extensive experimental evaluation on 85 datasets against state-of-the-art distance measures and clustering methods for time series using rigorous statistical analysis. SBD, our efficient and parameter-free distance measure, achieves similar accuracy to Dynamic Time Warping (DTW), a highly accurate but computationally expensive distance measure that requires parameter tuning. For clustering, we compare k -Shape and k -MS against scalable and non-scalable partitional, hierarchical, spectral, density-based, and shapelet-based methods, with combinations of the most competitive distance measures. k -Shape outperforms all scalable methods in terms of accuracy. Furthermore, k -Shape also outperforms all non-scalable approaches, with one exception, namely k -medoids with DTW, which achieves similar accuracy. However, unlike k -Shape, this approach requires tuning of its distance measure and is significantly slower than k -Shape. k -MS performs similarly to k -Shape in comparison to rival methods, but k -MS is significantly more accurate than k -Shape. Beyond clustering, we demonstrate the effectiveness of k -Shape to reduce the search space of one-nearest-neighbor classifiers for time series. Overall, SBD, k -Shape, and k -MS emerge as domain-independent, highly accurate, and efficient methods for time-series comparison and clustering with broad applications.