Generate 100 Random Numbers: How to Do It

How-to basics · Updated November 23, 2026

You can generate 100 random numbers instantly using a spreadsheet formula, a programming language, or an online generator. For example, in Excel, enter =RANDARRAY(100,1) in cell A1 to get 100 random decimals between 0 and 1, or =RANDARRAY(100,1,1,100,TRUE) for 100 integers from 1 to 100.

What “Random” Really Means

Random numbers are values produced without a predictable pattern. True randomness comes from physical processes like radioactive decay or atmospheric noise, but most everyday tools use pseudo-random number generators (PRNGs). PRNGs start with a “seed” value and apply a mathematical algorithm to produce a sequence that appears random but is actually deterministic. If you know the seed and the algorithm, you can reproduce the entire sequence. This is useful for testing and simulations, but it means the numbers are not truly random in a cryptographic sense.

Generating 100 Random Numbers in Excel

Excel offers several built-in functions for random numbers. The most versatile is RANDARRAY, available in Excel 365 and Excel 2021. It returns an array of random numbers with a specified number of rows and columns.

  • Random decimals between 0 and 1: =RANDARRAY(100,1) – put this in cell A1 and press Enter. You’ll get 100 rows in column A, each with a decimal like 0.4521.
  • Random integers between 1 and 100: =RANDARRAY(100,1,1,100,TRUE) – the third argument is the minimum, the fourth is the maximum, and TRUE means integers.
  • Random integers between 50 and 500: =RANDARRAY(100,1,50,500,TRUE)

If you’re using an older Excel version without RANDARRAY, you can use the older functions:

  • =RAND() – returns a decimal between 0 and 1. Copy this down 100 rows.
  • =RANDBETWEEN(1,100) – returns an integer between 1 and 100. Copy down 100 rows.

To turn the random numbers into static values (so they don’t recalculate every time you edit the sheet), copy the range, then right-click and choose Paste Special > Values.

Using Python or JavaScript

If you prefer coding, Python’s random module is simple. To generate 100 integers from 1 to 100:

import random
numbers = [random.randint(1, 100) for _ in range(100)]
print(numbers)

For 100 random decimals between 0 and 1, use random.random() in a list comprehension. In JavaScript (browser console or Node.js), you can use Math.random():

let numbers = [];
for (let i = 0; i < 100; i++) {
  numbers.push(Math.floor(Math.random() * 100) + 1);
}
console.log(numbers);

Note that Python’s random and JavaScript’s Math.random() are PRNGs, not cryptographically secure. For security-sensitive uses (like generating passwords), use secrets in Python or crypto.getRandomValues() in JavaScript.

Online Random Number Generators

If you don’t want to write code, many websites offer free random number generators. For example, random.org uses atmospheric noise to produce true random numbers, and you can specify a range and count (up to 10,000 numbers per request). Other sites like calculator.net or gigacalculator.com offer similar tools. When using an online generator, check that it allows you to set the count to 100 and the desired range. Some sites limit the output length or require you to copy the numbers manually.

How to Choose the Right Range and Distribution

Before generating, decide what you need the numbers for:

  • Uniform distribution: Each number in the range has an equal chance. This is the default for most generators and is what you get with RANDBETWEEN or random.randint.
  • Normal distribution: Numbers cluster around a mean. Excel doesn’t have a direct function, but you can use =NORM.INV(RAND(), mean, stddev) to simulate it.
  • No duplicates: If you need 100 unique numbers (e.g., for a lottery), you need to generate a larger set and remove duplicates, or use a shuffling algorithm. In Excel, you can use =SORTBY(SEQUENCE(100), RANDARRAY(100)) to get a random permutation of 1 to 100.

Common Problems and Fixes

One common issue is that Excel’s RAND() and RANDBETWEEN() recalculate every time the sheet changes, which can be annoying. To stop this, copy the numbers and paste as values. Another issue is that RANDARRAY may return a #CALC! error if you’re using an older Excel version – upgrade to Excel 365 or use the older functions.

If you need a seed for reproducibility (e.g., for a simulation), Excel doesn’t offer a seeded random function natively. In Python, you can set random.seed(42) before generating. In JavaScript, you’d need to implement a custom PRNG like a linear congruential generator.

Random Numbers in Statistics and Simulations

Random numbers are essential for statistical sampling, Monte Carlo simulations, and bootstrapping. For example, to estimate the average of a population, you might take a random sample of 100 values. In Excel, you can use the RAND() function to assign random sort keys to a list and then take the first 100. In Python, you can use random.sample(population, 100) to get a random subset without replacement.

When simulating dice rolls, coin flips, or other chance events, you can map random numbers to outcomes. For a fair six-sided die, use =RANDBETWEEN(1,6) in Excel or random.randint(1,6) in Python.

Frequently Asked Questions

How do I generate 100 random numbers without duplicates?

To get 100 unique numbers, you need to sample without replacement. In Excel, use =SORTBY(SEQUENCE(100), RANDARRAY(100)) to get a random permutation of 1 to 100. In Python, use random.sample(range(1, 101), 100) (which gives a shuffled list of 1–100). If you need unique numbers from a larger range, like 1 to 1000, use random.sample(range(1, 1001), 100).

Can I generate random numbers that don’t change in Excel?

Yes. After generating the numbers, select the range, copy it, then right-click and choose Paste Special > Values. This replaces the formulas with static values that won’t recalculate. Alternatively, you can set calculation to manual (Formulas > Calculation Options > Manual) and press F9 to recalculate only when you want.

What is the difference between RAND and RANDBETWEEN?

RAND() returns a decimal between 0 and 1 (like 0.2345). RANDBETWEEN(bottom, top) returns an integer between the two numbers you specify (inclusive). If you need decimals in a custom range, use =RAND()*(max-min)+min.

Are online random number generators safe to use?

For casual use like picking a winner, they’re fine. For security-sensitive applications (passwords, encryption keys), you should use a cryptographically secure generator, either from a trusted library or a hardware-based service. Random.org is generally reputable because it uses atmospheric noise, but always check the site’s privacy policy if you’re entering sensitive data.

How can I generate random numbers in Google Sheets?

Google Sheets has similar functions: =RAND() and =RANDBETWEEN(1,100). To generate 100 numbers, enter the formula in cell A1 and drag the fill handle down to A100. For an array formula, use =ARRAYFORMULA(RANDBETWEEN(1,100)) but it only fills one cell unless you use =ARRAYFORMULA(RANDBETWEEN(ROW(1:100)^0, 100)) – that’s a bit hacky. Simpler: use =RANDARRAY(100,1,1,100,TRUE) in Google Sheets as well, as it supports this function.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.