You have a cloud of points and no labels โ nobody told you which group each one belongs to. K-means finds the groups by itself. Drop k markers, colour every point by the nearest marker, then slide each marker to the middle of its colour, and repeat. Two tiny steps โ assign, then move โ chased until nothing changes. Scroll through and watch structure fall out of raw geometry.
Each round has exactly two steps. Assign: colour every point with the nearest centroid (the big โ). Move: slide each centroid to the mean of its points. Press Step to do one half-step at a time, or Auto-run to watch it converge โ the iteration counter stops climbing once nothing moves. Click the canvas to add your own points.
K-means isn't magic. It only finds a local optimum, so a different random start can give a different answer โ press New seed a few times and watch the clustering (and its total within-cluster distance) jump around. And k is your choice: this data has a clear number of blobs. Slide k and watch the elbow chart on the right โ the spot where adding another cluster stops buying much improvement is usually the right k.
One algorithm, a handful of ideas: