A random number is just a floating point number between 0.0 and 1.0. There is no code that prohibits certain ranges for a random number. You have to take that whole range and distribute it equally over the possible numbers. If all numbers are used except 1, 4, 6 and 7, you distribute the random number range equally over those four numbers: 0.00 <= Rnd < 0.25 --> 1 0.25 <= Rnd < 0.50 --> 4 0.50 <= Rnd < 0.75 --> 6 0.75 <= Rnd < 1.00 --> 7 The easiest way of doing that is of course to pick a random number between 0 and 3, and translate to the available numbers. --- b { font-weight: normal; }