Data Science & ML
Basic

Min-Max Normalization

Rescales features to the range [0, 1].

Formula

x′=x−xminxmax−xminx' = \frac{x - x_{min}}{x_{max} - x_{min}}

Live Calculator

Members

Variables

xValue
x_{min}Minimum
x_{max}Maximum

Example

x=25 in [0,100]: 0.25

How it works

Min-max normalization linearly stretches or compresses a value so the smallest value in a feature becomes 0 and the largest becomes 1. It works by measuring how far x is above the minimum, then dividing by the full data range, so the result is the fraction of the interval from minimum to maximum that x occupies. This preserves the original ordering of values and keeps the spacing proportional, just on a standardized scale.

When to use it

Use this when different numeric features need to be compared on the same scale, such as before distance-based methods like k-nearest neighbors or clustering. It is also useful when you want all inputs to lie in a fixed range, especially [0, 1], for neural networks or visualizations.

Worked example, step by step

Suppose a dataset has values from 10 to 50, and we want to normalize x = 30. Step 1: Identify the minimum and maximum: x_min = 10, x_max = 50 Step 2: Substitute into the formula: x' = (x - x_min) / (x_max - x_min) Step 3: Compute the numerator: 30 - 10 = 20 Step 4: Compute the denominator: 50 - 10 = 40 Step 5: Divide: x' = 20 / 40 = 0.5 Final answer: the normalized value is 0.5

Common mistakes to avoid

  • Using the sample's current value as the minimum or maximum instead of the true feature-wide min and max
  • Forgetting to subtract the minimum before dividing, which changes the scale incorrectly
  • Applying min-max normalization to new test data using test-set min and max instead of the training-set values

Did You Know?

Min-max scaling preserves the shape of the original distribution.

Share this formula

Reviewed & maintained by the FormulaWon editorial teamLast reviewed September 2026