Math.random Last updated: 16. May 2026
Returns a number, decimal between 0 and 1.
See also: Math.floor Math.round Math.ceil
Parameters
This function takes no parameters
Code example (#JS)
#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.#Math.round(Math.random() * 100)# Output
The #JS code above produces the output shown below:75