Free random code generator

Since we started, we have generated 58,217,873 free codes for you!

Generate up to 250,000 codes in the format of your choice for free. You can use the generated codes for purposes such as promotional codes (which you can, for example, print on the inside of packaging), serial numbers, one-time or multi-use passwords, lottery coupons, discount codes, vouchers, random strings and much more. For more use cases see our examples.

Please wait while the generator is loading
Please wait while the generator is loading

Frequently asked questions

What is the generator used for?
The generator allows you to create a set of codes in the format you specify. You can choose how many codes you want to generate, what length they will be, add your own text before and after each code, and even specify at which position in the code what characters are allowed. The codes will be generated in a format that is convenient for you, ranging from a simple text file, through CSV and json to Microsoft Excel files.
What can I use the generated codes for?
You can use the codes in any way that comes to mind. Below you will find some example uses for them:
- Discount codes/vouchers
- Lottery coupons
- Product labelling (e.g. for printing inside the packaging or under the cap)
- Serial numbers
- One-time or multi-use strong passwords
- Test data
I am looking for a promotional code for the website XYZ, how can I generate it?
If you are a customer and are looking for a promotional code to shop cheaper, this generator is not for you. Of course, it allows you to generate promotional codes, but these must first be entered into the shop you wish to shop at. The main purpose of this generator is to generate codes for website owners, promotions and lottery organisers or retailers.
What are similar characters?
Some characters, depending on the font used, can be very similar to each other and often impossible for a normal user to distinguish. For example, O (capital o) and 0 (zero) or I (capital i), l (small L) , 1 (numeral 1) and | (pipe character). Using these can lead to errors, as well as frustration for users who will often make mistakes when rewriting the printed code. For this reason, it is recommended that only easy-to-read and unambiguous characters are used in codes.
Is there a difference between a random number generator, a random code generator and a random string generator?
The random code generator as well as the random string generator work on the same principle. They are responsible for creating random character sets. The difference is only in the naming. The random integer generator is responsible for creating strings of characters which only consist of digits. With a code generator/string generator, it is possible to generate random numbers if only digits are selected in the set of allowed characters.
Can I use a code generator to generate random numbers?
Of course, all you need to do is choose the code to consist only of numbers. For example, to generate numbers from 0 to 999, set the generator so that the generated codes consist only of digits and the length to 3. Remember that smaller numbers will be padded by 0, e.g. 007. You can also, for example, set the generator to have only the digits 789 in the first position and the next four characters consist of a set of digits 0123456789 so that you get codes in the form of numbers from 7000 to 9999. You can also generate PIN codes in this way.
Is the code generator free of charge?
Yes. Generating codes with this generator is completely free. If you found it helpful, we would be very grateful if you would share a link to it on your social media or website so that more people can find out about it.
Can I choose what the generated code should look like?
The generated codes are fully customizable. Depending on your level of advancement, you can choose the appropriate mode in which you will be able to adapt the code to your needs.
What is the difference between basic, advanced and expert modes?
The basic configuration allows you to set the length and number of codes to be generated and to select one of the predefined character sets. The advanced configuration allows you to enter your own range of characters to be used to generate the code and add a prefix and suffix. In expert mode, you can define which character sets are allowed in which position of the code, which will allow you to create codes that best suit your needs.
What are duplicate codes? Are the codes generated always unique?
In most cases, you will want each code to occur only once in the list, meaning that it should be unique. However, there are cases where you may want the codes to repeat, i.e. there may be duplicates. You can choose whether you want the codes to be unique or not. It is also worth remembering that the configuration you choose can generate a limited number of unique codes, e.g. from a two-character code with ABC characters allowed, you can only generate 9 unique codes. But what if you need 20 codes in this format? Then you can use the option to allow duplicates, and the generator will generate exactly 20 codes, some of which will definitely be repeated.
What is the maximum number of codes I can generate?
You can generate up to 250,000 codes in one generation. You can use the generator for free up to 10 times per hour, which gives you the possibility to generate up to 1,250,000 codes per hour and up to 30,000,000 codes per day.
What is the maximum length of code I can generate?
The maximum length of the code that can be generated from the defined character set is 40 characters. Additionally, each code may contain a prefix and suffix you set, which can have a maximum length of 20 characters each. This means that using the maximum code, prefix and suffix lengths, your code can be up to 80 characters long.
What is a prefix?
The prefix is a fixed set of characters, defined by you, with which each code will start. Its maximum length is 20 characters. The prefix is an optional field and you do not need to enter it if you do not want to.
What is a suffix?
The suffix is a fixed character set defined by you with which each code will end. Its maximum length is 20 characters. The suffix is an optional field and you do not have to specify it if you do not want to.
I need my code to start with the country code. How to do it?
If you want each code to start with a country code, e.g. "US", you can use a prefix for this purpose. The generated codes will look, for example, like this US3X12A2. If you want the country code to be followed by a separator, e.g. a hyphen, add it to the end of the prefix, e.g. "US-" will give the code US-3X12A2.
In what format can I download the codes?
You can download the codes in several predefined formats, such as a text file, a CSV (comma-separated values) file that you can open e.g. using Microsoft Excel or LibreOffice Calc, a json file popular among programmers in a minimized or easy-to-read version, or a ready-made Microsoft Excel file.
What characters can the code consist of?
The code can consist of any available printable characters such as letters, numbers or special characters and even emoji. You can even generate full emoji codes such as 🙂❤️🙂🔑💪🎉. Additionally you can use patterns such as \L or \d to apply a specific character set. To learn more about the patterns read the patterns documentation.
Do you store generated codes?
No. The generated codes are not stored by us. When you download the generated file with codes, it is irreversibly deleted from the server and no one except you has access to it.
Will the codes I generate be used anywhere?
The codes generated belong exclusively to you and what you do with them is up to you. We will not store, share or process them in any way. They are yours.
How random are the codes?
We try to ensure that the codes generated for the configuration you choose are as random as possible, so there is a small chance that if you generate codes from the same configuration twice, you will get the same set of output codes. Of course, it all depends on how you set up the generator.
Can I increase the chance of drawing a certain character?
No. All characters in the code are treated equally. The repetition of a character in the code configuration will not affect its frequency of occurrence. All duplicates will be ignored. This means that the WWWWX and WX patterns have an identical chance of occurrence of the letter W in both cases.
Can anyone else generate the same codes as me?
Since we do not store what codes were generated by the generator, there is a chance that another user will set an identical generator configuration and, as a result, some of the codes will be identical to yours. If you want to ensure that the codes you generate will never be repeated by anyone else, set the maximum range of characters from which they can be generated and the maximum length possible. It's also a good idea to add a prefix that will be associated with you in some way, so there is a small chance that someone will type the same one. For example, if you use all lowercase and uppercase letters and special characters, and your code is 20 characters long, there are as many as 1,516,449,130,501,757,800,000,000,000,000,000,000,000 possible code variants to generate. For example, if you and someone else generate 1,000 codes, the chance that they will be repeated is close to zero.