Combination & Permutation Generator

Generate combinations and permutations from a set of items. Supports n choose k, nPr, and arrangements with or without repetition.

عرض الدليل
Settings
Choose input mode, items, size k, and whether to allow repetition.

Items will be 1, 2, 3, … n. Max 20.

Without repetition, k must be ≤ n.

دليل

What does this tool do

The Combination & Permutation Generator produces all possible combinations or permutations from a set of items. Choose items as numbers (1, 2, … n) or enter custom labels (e.g. A, B, C), set the size k, and pick whether order matters (permutation) or not (combination), with or without repetition. Copy results with one click. All generation runs in your browser—no server.

How to use it

  1. Choose input mode — Numbers 1..n uses integers 1 through n; Custom items lets you enter comma-separated labels.
  2. Enter items — For numbers, enter n (1–20). For custom, type items like A, B, C (max 20).
  3. Set size k — How many items per combination or permutation. Without repetition, k must be ≤ n.
  4. Select mode — Combination (order doesn't matter) or Permutation (order matters).
  5. Set repetition — No: each item used at most once. Yes: items can repeat.
  6. Generate — Click to produce the list. Use Copy all to copy results.

How it works

  • Combination without repetition C(n,k) = n!/(k!(n-k)!) — recursive generation of sorted subsets.
  • Combination with repetition C(n+k-1,k) — multisets of size k from n items.
  • Permutation without repetition P(n,k) = n!/(n-k)! — recursive backtracking over remaining items.
  • Permutation with repetition n^k — Cartesian product of k copies of the item set.

Results are capped at 10,000 displayed; beyond that, only the formula and count are shown. All computation runs entirely in your browser. No data is sent to any server.

Use cases & examples

  • Math & homework — Verify combinatorial counts, list all subsets or arrangements.
  • Games & puzzles — Enumerate possible hands, dice rolls, or lock combinations.
  • Sampling — List all ways to choose k items from n for experiments or trials.
  • Passwords & codes — Explore possible PIN or code arrangements (educational only).

Example

  • n=5, k=3, Combination, No repetition → C(5,3) = 10: (1,2,3), (1,2,4), (1,2,5), (1,3,4), (1,3,5), (1,4,5), (2,3,4), (2,3,5), (2,4,5), (3,4,5)
  • A, B, C, k=2, Permutation, No repetition → P(3,2) = 6: AB, AC, BA, BC, CA, CB
  • n=3, k=2, Permutation, Yes repetition → 3² = 9: 11, 12, 13, 21, 22, 23, 31, 32, 33

Limitations & known constraints

  • Max 20 items — n or custom items capped at 20 to prevent browser freeze.
  • Max 10,000 results displayed — For larger counts, only the formula and total are shown.
  • No export — Use Copy all to copy the list; no CSV or file download.

كل الحسابات والتحويلات تعمل بالكامل في متصفحك. لا تُرسل أي بيانات إلى أي خادم، فإدخالك لا يغادر جهازك أبداً.