Factoradic Converter

Convert numbers to the factorial number system and back, and use the digits to find the n-th permutation of a list or the rank of a permutation, with each step shown.

Converter Number Systems Updated Oct 3, 2026
How to Use
  1. Choose number to factoradic, factoradic to number, or permutation to rank.
  2. Type a whole number, a factoradic string such as 341010, or a permutation such as dfbaec.
  3. Optionally list the items to permute (abcdef, or 1 2 3 4 5 separated by spaces); the default is 0, 1, 2, ….
  4. Read the factoradic digits, the decimal value and the permutation they select.
  5. Show Work divides by 1, 2, 3, … or builds the Lehmer code item by item.
Input
optional
Presets
Factorial place values
Factoradic
—
Decimal
—
Permutation
—
Length
—

Worked Example

463 to factoradic. Divide by 1, 2, 3, … and keep the remainders: 463 ÷ 1 = 463 r 0; ÷ 2 = 231 r 1; ÷ 3 = 77 r 0; ÷ 4 = 19 r 1; ÷ 5 = 3 r 4; ÷ 6 = 0 r 3. Reading upwards: 341010. Check: 3 × 120 + 4 × 24 + 1 × 6 + 0 × 2 + 1 × 1 + 0 = 463.

The 463rd permutation of abcdef. Use the digits to pick from what is left: 3 → d (from a b c d e f); 4 → f (from a b c e f); 1 → b; 0 → a; 1 → e; 0 → c. The permutation is dfbaec, counting from 0 in alphabetical order.

The common mistake: counting from 1. These ranks start at 0, so 0 is abcdef itself and 719 is fedcba. The “millionth” permutation in the everyday sense is index 999,999: for the digits 0–9 it is 2783915460.

Show Work

Enter a number to see the step-by-step working.

Formulas

Value
n = Σ dk × k!
0 ≤ dk ≤ k
Conversion
÷1, ÷2, ÷3 … keep remainders
Lehmer code
di = # later items smaller than item i
Largest with n digits
n! − 1
543210 = 719
Permutations
n items have n! orders

Counting Permutations

The factorial number system was described by Charles-Ange Laisant in 1888, and its use for numbering permutations is named after Derrick Lehmer, who wrote about such codes in the 1960s. It is a mixed-radix system like the one that writes time in days, hours, minutes and seconds, except that each place’s radix grows by one.

Because the factoradic digits of 0 to n! − 1 run through every permutation of n items exactly once, the system turns “the k-th arrangement” into simple arithmetic. Programmers meet it in puzzles such as Project Euler’s problem 24, in random shuffles, and in compact indexes of puzzle states.

About This Calculator

This converter turns whole numbers of any size into the factorial number system and back, and links the digits to permutations: it gives the permutation with a given rank for any list of items and the rank of a given permutation. It shows the divisions, the place values k! and the item-by-item Lehmer code.

Everything runs in your browser; nothing is sent anywhere. Ranks count from 0 in sorted order.

Related calculators: Mixed Radix Converter, Zeckendorf Converter, and Number Base Converter.

Frequently Asked Questions

What is the factorial number system?

A mixed-radix system whose place values are factorials: 1, 1, 2, 6, 24, 120, 720 and so on (0!, 1!, 2!, 3!…). The digit in place k can be at most k. Every whole number has exactly one representation: 463 = 3 × 120 + 4 × 24 + 1 × 6 + 0 × 2 + 1 × 1 + 0 × 1, written 341010.

How do I convert a number to factoradic?

Divide by 1, then the quotient by 2, then by 3, and so on, keeping each remainder, until the quotient is 0. The remainders read from last to first are the digits. 463: ÷1 r 0, ÷2 = 231 r 1, ÷3 = 77 r 0, ÷4 = 19 r 1, ÷5 = 3 r 4, ÷6 = 0 r 3, so 341010.

How does factoradic give the n-th permutation?

The digits are a Lehmer code: each one says which of the remaining items to take next, counting from 0. For n = 463 and the items abcdef, the digits 3, 4, 1, 0, 1, 0 pick d, then f, then b, a, e and c: the 463rd permutation (counting from 0, in alphabetical order) is dfbaec.

How do I find the rank of a permutation?

For each item, count how many items after it are smaller; those counts are the factoradic digits. For dfbaec: d has 3 smaller later items (b, a, c), f has 4, b has 1, a 0, e 1 and c 0, giving 341010 = 463.

Where is this used?

Anywhere permutations need to be numbered or stored compactly: shuffling algorithms, puzzle solvers that index every position of a Rubik’s cube corner set, combinatorial testing, and compressing a ranking into a single integer.

How do I use the Factoradic Converter?

Simply type or paste your value and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.

Is it free? Does it work without internet?

Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.

Where does my data go?

Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.

Common Use Cases

Combinatorics

463 = 341010 selects the permutation dfbaec of abcdef.

Ranking

dfbaec has rank 463 among the 720 permutations of six letters.

Last permutation

719 = 543210 gives fedcba, the reverse order.

Programming puzzles

The millionth permutation of the digits 0–9 is 2783915460 (index 999,999).

Last updated: