Clustered Dataset Generator
Clustering algorithms always return clusters. That is the problem: run k-means asking for four groups on data that has two, and you get four confident groups. Testing against data whose true grouping you know is the only way to tell recovery from invention, so every point here carries the group it was actually drawn from.
What this generator does
Places cluster centres evenly around a circle so they are always well separated and reproducible, then draws points around them with Gaussian scatter. Group sizes are kept within one of each other, and every point records the centre it came from.
How to use this tool
- Choose how many clusters and how many points.
- Set the spread — above about 20 the groups genuinely overlap.
- Generate and copy the CSV, which includes the true cluster for each point.
- Compare what your algorithm recovered against the labels.
Understanding the controls
- How many clusters
- Between 2 and 8, evenly sized. Asking your algorithm for a different number than this is the useful experiment.
- Spread
- How far points scatter from their centre. Small values give obviously separate blobs; above about 20 the groups genuinely overlap and the tool says so.
- How many points
- Divided as evenly as possible between the clusters.
- Seed
- Reproduces the identical point set, which makes two algorithms comparable on the same data.
Common use cases
- Testing a clustering implementation against known groups
- Showing that an algorithm returns clusters whether or not they exist
- Producing labelled 2D data for a scatter-plot component
- Teaching why cluster validity measures are needed
- Checking behaviour as groups move from separated to overlapping
How this generator works
Centres sit at equal angles on a circle of fixed radius, which guarantees separation without needing rejection sampling. Points are assigned to clusters round-robin so the groups stay balanced, then displaced by a Gaussian draw scaled by the spread.
Randomness and fairness
The scatter around each centre is random; the centres themselves are not — they are fixed by the cluster count. Seeded runs are reproducible and therefore explicitly not cryptographically secure; unseeded ones use the browser's cryptographically secure generator.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- Clusters are spherical and equally sized. Real clusters are often elongated, nested or wildly unequal, and those are the cases that break algorithms.
- Two dimensions only, so it cannot demonstrate the curse of dimensionality.
- Centres are always evenly spaced, which is friendlier than most real data.
- Nothing is retained between visits; seed a dataset you want to reuse.
Privacy and your data
Points are generated locally in your browser. No settings, seeds or generated coordinates leave the page or persist after it closes.
Related generators
- Regression Dataset GeneratorData built from a slope and intercept you choose, with the line fitted back out of it so you can see how close estimation gets.
- Point Cloud GeneratorClustered two-dimensional points with the cluster labels kept, and the within-cluster and between-cluster distances measured.
- Correlated Dataset GeneratorTwo numeric columns with a correlation you choose, plus optional blanks, duplicate rows and outliers — for testing charts, cleaning pipelines and statistics teaching.
- Synthetic Test Data GeneratorBuild a whole table of fictional records from the fields you choose, then export them as a table, JSON, CSV or SQL inserts.