You can generate random letters and numbers in Excel by combining the CHAR function, which returns a character from a numeric code, with RANDBETWEEN, which produces a random integer between two bounds, or by using the newer RANDARRAY function for an entire spill range. For letters, the classic formula is =CHAR(RANDBETWEEN(65,90)) for uppercase A–Z and =CHAR(RANDBETWEEN(97,122)) for lowercase a–z; for numbers, =RANDBETWEEN(0,9) returns a single random digit. Wrapping these inside TEXTJOIN with an empty delimiter produces a string of any length you can paste into a cell, label, or test dataset.

Spreadsheets are surprisingly common places to need quick random output. Test engineers need sample IDs to stress-import routines. Teachers build randomized spelling lists or quiz scrambles. Game designers prototype letter pools for word puzzles. Marketers mock up coupon codes. In every case, the goal is the same: produce believable random strings without typing them by hand and without leaving Excel. The good news is that Excel has built-in functions that handle both letters and numbers, and the formulas are short enough to memorize after a single use. When a one-off batch is all you need, a dedicated browser tool such as the Random Letter Generator delivers the same result with no formula at all.

how to generate random letters and numbers in excel
how to generate random letters and numbers in excel

Excel Functions You Need for Random Letters and Numbers

Before building any formula, it helps to know the three functions that do almost all of the work in Excel.

FunctionPurposeExample Output
CHAR(code)Returns the character for an ASCII code=CHAR(65) → "A"
RANDBETWEEN(low, high)Random integer between two values, inclusive=RANDBETWEEN(1,6) → 4
RAND()Random decimal from 0 up to 1=RAND() → 0.3728
RANDARRAY(rows, cols)Spills a grid of random numbers=RANDARRAY(5,3) → 5x3 grid
TEXTJOIN(delim, ignore, text1, ...)Joins many text strings with a delimiter=TEXTJOIN("",TRUE,A1:A10) → one string

The ASCII codes for uppercase A–Z run from 65 to 90, and lowercase a–z run from 97 to 122, which is why CHAR combined with RANDBETWEEN is the standard recipe for random letters. For more on the ASCII table itself, the Wikipedia entry on ASCII is a clean reference.

Generate a Single Random Letter in Excel

The simplest case is one random letter in one cell.

  1. Click any empty cell, for example A1.
  2. Type =CHAR(RANDBETWEEN(65,90)) for an uppercase letter, or change 65,90 to 97,122 for lowercase.
  3. Press Enter. The cell now shows a random letter such as K or m.
  4. Press F9 to recalculate and pick a new letter; every recalculation re-rolls the value.

If you need only vowels or only consonants, swap the numeric range. Vowels are split between 65, 69, 73, 79, 85 (uppercase) and 97, 101, 105, 111, 117 (lowercase), so you can use INDEX with a small array to pick from just those five codes. Most users, however, prefer to filter results after generation or use a tool that exposes a vowel or consonant toggle directly, which is what the Random Letter Generator does in a single click.

Build a String of Random Letters and Numbers

To fill a single cell with a string such as 8 characters long, combine CHAR, RANDBETWEEN, and TEXTJOIN. The exact arithmetic of one example: with the formula =TEXTJOIN("",TRUE,CHAR(RANDBETWEEN(65,90)),CHAR(RANDBETWEEN(65,90)),CHAR(RANDBETWEEN(65,90)),CHAR(RANDBETWEEN(65,90)),CHAR(RANDBETWEEN(0,9)+48),CHAR(RANDBETWEEN(0,9)+48),CHAR(RANDBETWEEN(0,9)+48),CHAR(RANDBETWEEN(0,9)+48)), the inner CHAR calls each return one character and TEXTJOIN glues them together with no separator; the +48 offsets convert a digit 0–9 to its ASCII code, since the digit "0" is ASCII 48 and "9" is ASCII 57.

Drag that formula down a column to produce as many codes as you need. Every recalculation, including edits elsewhere in the workbook, will re-roll the string, so lock the results with Paste Special → Values once you have what you want.

Using RANDARRAY for Bulk Output

On Microsoft 365, RANDARRAY makes batch generation almost trivial. To fill ten rows of random uppercase letters in column A starting at A1, enter =CHAR(RANDBETWEEN(65,90)) in A1, then drag down to A10, or use the dynamic-array form =CHAR(SEQUENCE(10,1,65,0)) combined with RANDBETWEEN for a spilling grid. For random 4-digit numbers in B1:B10, use =RANDBETWEEN(1000,9999). RANDARRAY returns the same type of values without dragging, which is helpful when you need hundreds of rows.

Generate Random Numbers Only

Random numbers in Excel do not need CHAR at all. Pick the function that matches your range.

  • =RANDBETWEEN(1,100) gives integers from 1 to 100, inclusive.
  • =RAND()*100 gives a decimal from 0 up to but not including 100.
  • =INT(RAND()*50)+1 gives integers from 1 to 50 using only the older RAND function.
  • =RANDARRAY(20,1,1000,9999,TRUE) on Microsoft 365 spills 20 random integers between 1000 and 9999 in one step.

For full coverage of the numeric side, the guide on generating random numbers in MATLAB shows how similar principles apply in other environments, and the Random Number Generator is a quick browser alternative when you do not need a formula at all.

When a Browser Tool Is Faster Than a Formula

Formulas are great inside a live workbook, but there are common situations where opening a browser tool is the better path. If you need a string before you even open Excel, if you want to control case, vowel or consonant pooling, and repeat rules through a visual interface, or if you need to share the output with someone who does not know Excel, a generator is faster. The Random Letter Generator covers exactly that workflow: choose a count from 1 to 100, pick uppercase, lowercase, or mixed case, optionally restrict to vowels or consonants and toggle repeats on or off, then press Generate. A Copy button puts the result on your clipboard so it can be pasted straight into a cell, an email, or a code field.

The same shortcut logic shows up in related tools. A coin flip handles binary decisions, a dice roller covers d4 through d20, a username generator produces brandable handles, and a random team generator splits any roster into balanced groups. Each one removes a small but annoying piece of friction from a workflow where you already have too much to do.

Generate Random Letters With the Online Tool

  1. Open the Random Letter Generator in your browser.
  2. Type the number of letters you want in the count field, anywhere from 1 to 100.
  3. Select the case: uppercase, lowercase, or mixed.
  4. Optionally pick the vowels-only or consonants-only filter, and decide whether repeated letters are allowed.
  5. Press Generate and review the output.
  6. Click Copy, then switch to Excel and press Ctrl + V to paste the string into the active cell.

Stop Excel from Re-Rolling Your Random Values

Every formula in this article is volatile, which means it recalculates on any change. That is useful while you are experimenting but disastrous once the data is "final". To freeze random output:

  1. Select the cells that contain the random strings or numbers.
  2. Press Ctrl + C to copy.
  3. Press Ctrl + Shift + V to open Paste Special.
  4. Choose Values and click OK.

The formulas are replaced by literal text or numbers, and the values stay fixed forever. This single step is the difference between a clean dataset and one that quietly changes underneath your analysis.

Common Use Cases for Random Letters and Numbers in Excel

  • Test data. Generate hundreds of fake order IDs, email addresses, or coupon codes for QA scripts and demos.
  • Classroom tools. Build randomized spelling lists, group assignments, or quiz orderings.
  • Sampling. Pick a random subset of rows using =INDEX(A:A, RANDBETWEEN(2, COUNTA(A:A))) instead of pulling names by hand.
  • Password or token creation. Create one-off access codes for guests or short-lived download links.
  • Games and puzzles. Prototype Boggle boards, Wheel of Fortune rounds, or anagram challenges.

For deeper coverage of producing random text for specific tasks, the guide on generating random letters for any task in one click walks through several of these scenarios in more detail, and the Python random characters guide shows the same idea in code for developers who prefer scripting.

Practical Tips and Pitfalls

A few small habits save real time when random output is part of your regular workflow.

  • Watch the boundaries. RANDBETWEEN is inclusive on both ends, so RANDBETWEEN(0,9) can return exactly 0 or exactly 9.
  • Mind the case. ASCII 65–90 is uppercase, 97–122 is lowercase; mixing them with a single formula is easy with CHOOSE or RANDBETWEEN switching between two ranges.
  • Use SEQUENCE for length. TEXTJOIN("",TRUE,CHAR(SEQUENCE(8,1,65,90))) on Microsoft 365 produces an 8-character uppercase string in one cell without dragging.
  • Validate distributions. If your simulation depends on uniformity, spot-check a column of RANDBETWEEN results to confirm the spread matches expectations.
  • Combine sources when needed. A real-looking coupon code often needs both letters and digits, which is exactly the mixed output the Random Letter Generator produces with the click of a button.

Whether you stay inside Excel or jump to a browser tool, the workflow is the same: pick a function or a tool, set the rules, generate, and lock the results. Once you have done it a couple of times, generating random letters and numbers in Excel becomes a two-minute task instead of a twenty-minute one.