Random String Generator
Generate random string using the options shown.
About Random String Generator
Developers and testers often need a throwaway string: a sample API token for documentation, a unique-looking ID for test records, a coupon code mockup or filler for a field-length test. Typing random keys by hand produces patterns. Generating the string from a character set you control gives a quick, unpatterned value of an exact length.
How it works
You set a length from 1 to 500 (default 24) and the allowed characters, which default to A-Z, a-z and 0-9. The tool fills an array with values from the browser's crypto.getRandomValues function and maps each one to a character using the remainder after dividing by the size of your character set. Characters listed twice in the set become twice as likely. The string is produced locally and can be saved as random-string.txt. Nothing is stored or sent anywhere.
How to use Random String Generator
- Complete the available fields: String length, Allowed characters. Use the field labels and examples shown in the workspace.
- Select “Generate” and check the result before copying or downloading it.
Worked example
Set the length to 8 and the allowed characters to 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789', which leaves out the look-alikes I, O, 0 and 1. A run returns a string such as 'K7QM2XRA'. Every run gives a different 8-character result drawn only from those 32 characters.
Tips for a better result
- Remove confusing characters such as O, 0, I, l and 1 from the set when people will read or type the string, like voucher codes.
- Type each allowed character only once in the set; duplicates silently make those characters appear more often.
- For anything protecting real accounts, use your password manager or platform's own generator so the value is created and stored in one trusted place.
Frequently asked questions
Can I include symbols like ! or #?
Yes. Any character you type into the allowed characters field can appear, including symbols, spaces and accented letters. Check that the system you will paste into accepts those characters.
Will two strings ever be the same?
It is possible but very unlikely with the default 62-character set and 24 characters. With a short length or a tiny character set, repeats become much more likely, so increase the length if uniqueness matters.
Is every character equally likely?
Very nearly. Mapping a 32-bit random value with a remainder introduces a tiny bias toward characters early in the set, too small to notice for typical set sizes.
What to check
Review punctuation, formatting and meaning before using transformed text elsewhere.
Read the Privacy Policy for information about local processing, connected services and advertising.