Silhouette score calculator

Enter the points and the cluster each one belongs to — the output of k-means or any other clustering. The calculator computes the silhouette of every point, the mean per cluster and the overall silhouette score, which tells you how well separated the clusters are.

Coordinates of each point, points separated by ; e.g. 1 2; 2 1; 8 8
One label per point, in the same order, e.g. A A B
Silhouette score (mean)0.8256
Interpretation
Strong structure (above 0.70)
Mean per cluster
A: 0.8249, B: 0.8262
Per point (first 20)
0.8551, 0.8238, 0.7959, 0.8384, 0.8083, 0.832
Points with a negative silhouette
0
Clusters
2
Points
6

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Enter the points: the coordinates of each point separated by spaces or commas, and the points separated by semicolons (any number of dimensions, the same for all points).
  2. Enter one cluster label per point, in the same order — letters, numbers or words.
  3. Read the silhouette score, its interpretation, the mean of each cluster and the first 20 point values.

How it works

For every point i, with Euclidean distances:

  • a(i) = mean distance from i to the other points of its own cluster;
  • b(i) = for each other cluster, the mean distance from i to its points — take the smallest;
  • s(i) = (b(i) − a(i)) ÷ max(a(i), b(i)), and s(i) = 0 if i is alone in its cluster.

The silhouette score is the mean of s(i) over all points, as scikit-learn’s silhouette_score computes it.

Worked example

Six points in two groups: A = (1, 2), (2, 1), (2, 3) and B = (8, 8), (9, 7), (9, 9).

For the point (1, 2):

  • a = mean distance to (2, 1) and (2, 3) = (√2 + √2) ÷ 2 = 1.4142;
  • b = mean distance to cluster B = (√85 + √89 + √113) ÷ 3 = 9.7612;
  • s = (9.7612 − 1.4142) ÷ 9.7612 = 0.8551.

Doing the same for every point gives cluster means A: 0.8249 and B: 0.8262, and a silhouette score of 0.8256 — a strong structure.

Tips

  • Scale your features first. Distances mix all coordinates, so a feature measured in thousands drowns one measured in fractions.
  • The silhouette favours round, even clusters. For long or nested shapes found by DBSCAN, a low score does not always mean a bad clustering.
  • To compare two points directly, use the Manhattan and Euclidean distance calculator.

Frequently asked questions

What is the silhouette score?

A measure of how well each point fits its cluster compared with the nearest other cluster, from −1 to 1. For a point, a is the mean distance to the other points of its cluster and b the smallest mean distance to the points of another cluster; its silhouette is (b − a) ÷ max(a, b). The score of a clustering is the mean over all points.

What is a good silhouette score?

Close to 1 means compact, well-separated clusters; near 0 means clusters touch or overlap; negative values mean points are closer to another cluster than their own. Kaufman and Rousseeuw suggested above 0.70 as strong, 0.51–0.70 reasonable, 0.26–0.50 weak and 0.25 or less as no substantial structure.

How do I use it to choose k in k-means?

Run the clustering for several values of k, compute the silhouette score for each, and prefer the k with the highest score — then check the per-cluster values, since one poor cluster can hide behind a good mean.

What happens to a cluster with one point?

Its point gets a silhouette of 0, as defined by Rousseeuw and done in scikit-learn, since a is not defined for it. The score also needs at least 2 clusters and fewer clusters than points.

More in Developer

All tools in this category: Developer ·Updated November 7, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.