Permutation Generator
Generate all distinct arrangements (permutations) of a string, rank and unrank them with the Lehmer code / factoradic system, and walk the lexicographic sequence with next/previous. Handles repeated characters as a multiset — so "AAB" yields three arrangements (AAB, ABA, BAA), not six — counting them with the multinomial coefficient n! ∕ ∏counti! (the famous "MISSISSIPPI" has 34,650 distinct rearrangements). Rank gives the 0-based position of any permutation in sorted order; unrank is its inverse. Pairs with the Combination Generator and Combinatorics tools. Everything runs locally in your browser.
Count & all permutations
Rank a permutation
Unrank an index
Permutations & the factoradic number system. A permutation of n distinct items has n! arrangements; with duplicates it is the multinomial n! ∕ ∏counti!. The Lehmer code writes a permutation as digits di = (number of unused items smaller than the one placed at position i); read in mixed radix (n−1, n−2, …, 1, 0)! it gives the permutation's 0-based rank — this is the factoradic (factorial base) representation. Unrank reverses it: repeatedly divide the rank by successive factorials to recover each digit, then pick that index from the remaining items. So "BCA" is rank 3 of the six permutations of ABC, and rank 4 un-ranks to "CAB". Next permutation (Narayana Pandita's 14th-century algorithm) finds the rightmost ascent, swaps with the smallest larger tail element, and reverses the suffix — it steps through the sorted sequence one at a time and naturally skips duplicate arrangements in a multiset. The full list is capped for display when the count is large. Pairs with the Combination Generator, Combinatorics, and Derangements tools. Everything runs locally — nothing leaves your browser.