%3C/text%3E%3C/svg%3E">
💻
💻 Tech & IT

Train / Validation / Test Split Calculator

Results update as you type.

Your numbers

Understanding the train / validation / test split calculator — concept and principle

This calculator turns percentages into actual sample counts for a training, validation and test split, and tells you how many batches (optimizer steps) one pass over the training set takes. Use it when preparing a dataset, setting up data loaders, or estimating how long an epoch will run.

Train, validation and test split with batches10,000 samples split 70/15/15 give 7,000, 1,500 and 1,500; 7,000 in batches of 32 is 218 full batches plus one of 24, so 219 steps.10,000 samples cut into three piles1 square = 500 samplesTrain7,00070%Val1,50015%Test1,500restTrain set in batches of 32… 218 full × 321 × 247,000 ÷ 32 = 218.75 → 219219 steps per epochthe last batch is smaller
Test takes whatever is left, and the partial last batch still counts as a step.

How it is calculated

The test percentage is not entered; it is implied as 100 − train% − validation%.

The principle

A model must be judged on data it has never seen. The training set is used to fit the weights; the validation set guides choices such as hyperparameters, architecture and early stopping; the test set is touched once at the end to give an unbiased estimate of real-world performance. Because you look at validation results repeatedly, the model gradually becomes tuned to that set, which is why a separate, untouched test set is needed. Rounding the first two counts and giving the remainder to test avoids losing or double-counting a sample.

Worked example

  1. Inputs: N = 10,000, train 70%, validation 15%, batch size 32.
  2. Train = round(10,000 × 0.70) = 7,000.
  3. Validation = round(10,000 × 0.15) = 1,500.
  4. Test = 10,000 − 7,000 − 1,500 = 1,500 (the implied 15%).
  5. Result: 7000 / 1500 / 1500.
  6. Steps per epoch = ceil(7,000 ÷ 32) = ceil(218.75) = 219; the last batch holds 24 samples.

How to read the result

Common splits are 70/15/15 and 80/10/10. With very large datasets (millions of samples), 1–2% each for validation and test is often plenty, because what matters is the absolute number of evaluation examples. With small datasets, a fixed split wastes data and makes estimates noisy; k-fold cross-validation is usually better. Steps per epoch × number of epochs gives the total optimizer steps, which you need for learning-rate schedules.

Common mistakes

Keep in mind: Counts here are simple arithmetic. They do not check class balance, duplicates, grouping or time order; for time series, split by time so the test period comes after the training period.

Frequently asked questions

Why does the test set get the remainder?

Rounding each part independently can make the total one off from N. Giving test the remainder keeps the sum exact.

Do I always need a validation set?

If you choose any setting by looking at results, yes, or use cross-validation. Otherwise you end up tuning on the test set.

Sources: T. Hastie, R. Tibshirani and J. Friedman, The Elements of Statistical Learning, 2nd ed., Springer, 2009, Section 7.2 and 7.10 · I. Goodfellow, Y. Bengio and A. Courville, Deep Learning, MIT Press, 2016, Section 5.3

Checked 8 Nov 2026. Standard formulas and RFC/IEEE definitions, computed locally in your browser — nothing you type is sent anywhere.

💻 All tech & IT tools →🌍 Calculators by country →