Dataset Split Calculator
Calculate train, validation, and test set sizes from a dataset split ratio.
About Dataset Split Calculator
Dataset splitting divides your total samples into three sets used for different purposes: training samples update model weights, validation samples tune hyperparameters and monitor overfitting during development, and test samples give a final, untouched estimate of real-world performance. A common default is an 80/10/10 split, though larger datasets can often use a smaller validation/test percentage (e.g. 98/1/1) since even 1% of a very large dataset is statistically sufficient, while smaller datasets often need a larger validation/test share to get reliable estimates.
Formula
train_samples = round(total * train_percent / 100); val_samples = round(total * val_percent / 100); test_samples = total - train_samples - val_samples
- total
- Total number of samples in the dataset
- train_percent
- Percentage allocated to training
- val_percent
- Percentage allocated to validation
Worked example
With the default values below, Dataset Split Calculator returns Training Samples of 80,000. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Total Samplesaccepts 1–1,000,000,000,000 samples
- 100,000 samples
- Train %accepts 0–100 %
- 80 %
- Validation %accepts 0–100 %
- 10 %
- Test %accepts 0–100 %
- 10 %
Results
- Training Samples
- 80,000
- Validation Samples
- 10,000
- Test Samples
- 10,000
Step by step
- 1Train samples: total × train%= 80,000
- 2Validation samples: total × val%= 10,000
- 3Test samples: total − train − validation (avoids rounding drift)= 10,000
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
What is stratified sampling and why does it matter?
Stratified sampling ensures each split (train/val/test) preserves the same class/label distribution as the full dataset — this is important for imbalanced datasets, since random sampling alone could leave a minority class underrepresented or entirely absent from one split.
Why do percentages sometimes not add up to exactly 100%?
If your entered train/val/test percentages don't sum to 100, this calculator proportionally rescales them so the resulting sample counts still add up to your total dataset size correctly.
Should I always use an 80/10/10 split?
It's a reasonable default, but very large datasets (millions+ samples) often shrink validation/test to just 1-5% each since that's still plenty of samples for reliable evaluation, freeing up more data for training; very small datasets may need k-fold cross-validation instead of a single fixed split.
What's the difference between validation and test sets?
The validation set is used repeatedly during development to tune hyperparameters and select the best model checkpoint, while the test set should be used only once, at the very end, to report an unbiased estimate of final model performance.
