How to generate all permutations of given string?
Introduction
Generating all permutations of a word involves creating every possible ordered arrangement of its characters based on specific rules. For example, the word "ABCD" can be used to generate 256 different 4-character codes when repetitions are allowed. This process is often handled using an advanced code generator configuration.
To begin, input the characters from the original word into the field labeled "Set of characters that can appear in the code." This defines the character pool used during code generation. Next, set the "Single code length" parameter to match the length of the input word-4 in the case of "ABCD." This ensures that each generated code is of uniform length.
Then, specify the "Number of codes to generate" according to the total number of possible permutations given the selected configuration. For four characters with repetition allowed and code length set to four, the total number of permutations is calculated as 44 = 256. If repetition were disallowed, the correct value would instead be the factorial of the length, 4! = 24.
The exact number of possible combinations under your configuration can be verified in the help description of the field "Set of characters that can appear in the code." This ensures alignment between the generator settings and the expected output volume.
Example codes
Below you will find 10 examples of all permutations of given string.
Generator configuration
Our free all permutations of given string generator needs the appropriate settings to generate a file with data in the right format. Below is the exact configuration that should be set to get the effect as in the example above.
Generator mode | Advanced |
---|---|
Prefix | Leave empty |
Suffix | Leave empty |
Allow duplicated codes? | No |
Single code length | 4 |
Set of characters that can appear in the code | ABCD |
Quick actions
Previous example: Country prefixed codes
Next example: Random IPv4 address