What distance metric is used in K-Means and why?

Updated May 16, 2026

Short answer

K-Means typically uses Euclidean distance to assign points to clusters.

Deep explanation

Euclidean distance works well because K-Means minimizes variance within clusters. The centroid is the mean, which is optimal under squared Euclidean distance assumptions.

Real-world example

Grouping similar customers based on numeric features.

Common mistakes

  • Using K-Means with categorical data directly.

Follow-up questions

  • Can K-Means use other distances?
  • Why squared distance?

More K-Means Clustering interview questions

View all →