Generate a random string

Generate bounded strings from either a 62-symbol alphanumeric alphabet or explicitly supplied Unicode code points.

freeworks offlinenothing uploaded
ToolRandom String Generator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

The built-in alphabet contains uppercase and lowercase Latin letters plus digits. Custom input is deduplicated by Unicode code point, then every requested position uses rejection sampling to index that set; seed text replaces Web Crypto with a deterministic stream.

Formula
default alphabet size = 26 uppercase + 26 lowercase + 10 digits = 62
  • Length and row count are required because fixture schemas impose different bounds.
  • The output ceiling is 256 code points per row and 1,000 rows per request.

Worked example

Five 8-character strings
Input
											Length: 8
Count: 5
Seed: fixture-seed
										
Output
												CIPI3NcQ
mRibmpcQ
1Tf1moI7
8LTQk8Jx
h3ZwjFLj
											

When to use this

Property-based tests constrain generated parser inputs, UI prototypes populate sample identifiers, and Unicode fixtures exercise punctuation, emoji, or combining-mark handling.

Edge cases

  • aaab contains two distinct choices, not four weighted positions, because duplicate alphabet code points are removed.
  • 😀 is selected as one code point and never split into invalid UTF-16 surrogate halves.
  • A joined emoji or letter-plus-combining-mark sequence contains multiple code points, so requested length can differ from visible grapheme count.

References