Random Integer

A random whole number between a minimum and a maximum, both included.

Node id math/random-integer

The Random Integer node outputs a random whole number from min to max, each equally likely. By default it is 0 or 1.

Inputs

NameTypeDefaultNotes
minnumber0
maxnumber1

Outputs

NameTypeNotes
resultnumber

Behaviour

  • Both ends included. With min = 1 and max = 6, it is like a die: 1, 2, 3, 4, 5 or 6.
  • Fractional limits are rounded inwards: min = 0.5 and max = 3.5 give 1, 2 or 3.
  • Repeatable. As with Random Number, the numbers come from a seeded sequence: the same graph always draws the same picture, and each node has its own sequence. For other values, give the node a new seed (the dice in the inspector, or New random seed in its context menu).

Errors

  • min greater than max (including NaN for either) is an error.
  • So is a range with no whole number in it, such as 0.2 to 0.8.
  • Random Number: any number in a range.
  • Get: with a random index, a random element of an array.
© 2026 Wirepaint