Home▸Machine Learning & Neural Networks▸K-Means Clustering (2D)

🎯 K-Means Clustering (2D)

Interactive 2D K-means clustering: adjustable cluster count and point count, real assignment and update steps, step-by-step or auto convergence, live inertia (WCSS) readout, click to add data points.

Machine Learning & Neural Networks2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-k-means-clustering ↗ Open standalone
⚙ Under the hood

Cluster random 2D data points with the real K-means algorithm: pick the number of clusters and points, step through the assignment and update phases one iteration at a time or let it run automatically, and watch the inertia (WCSS) drop as the centroids converge. Click anywhere on the canvas to drop your own points and see the algorithm re-fit around them.

machine-learningclusteringunsupervised-learningk-meansalgorithmcanvas2d

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)