How would I normalize a number between 0 and 1?

I have looked online and I cannot find the formula I have tried a few and they do not return between 0 and 1 and others just returned inf or nan. Can anyone help me? I want to normalize 20 between 0 and 1.

Thanks

1 Like

You can normalize a value from 0 to 1 by dividing the value by the maximum value

So to normalize a number from 0 to 50, divide the value by 50

To normalize it not to 0, do:
(number-min)/(max-min)

So like from 20 to 60

(number-20)/(60-20)

5 Likes