Permutation & Combination Calculator API

GET

Solve permutations and combinations without writing custom math.

Calculate permutations (P(n,r)) and combinations (C(n,r)) for any given values of n and r.

Try it — live request, no key required

Request
GETapi.apiverve.com/v1/permutationcombination?n=10&r=3
Query parameters
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "n": 10,
    "r": 3,
    "permutation": 720,
    "combination": 120,
    "formulas": {
      "permutation": "P(n,r) = n! / (n-r)!",
      "combination": "C(n,r) = n! / (r! × (n-r)!)"
    }
  }
}

About the Permutation & Combination Calculator API

Perfect for probability calculations, statistics problems, and combinatorial analysis in mathematics.

What people use it for

Education
Solve permutation and combination problems for homework and exams
Probability
Calculate odds and probabilities in statistics
Programming
Determine algorithm complexity and counting problems
Game Design
Calculate possible combinations for game mechanics

Ways to call it

One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.

JSON
Default REST response
XML
Markup format
YAML
Human-readable
CSV
Tabular export
Beta
GraphQL
Query language
New
MCP
For AI agents

Other ways to use Permutation & Combination Calculator

Same data, same APIVerve account, same credit balance — one key works on all of them.

Questions.

Common questions about the Permutation & Combination Calculator API.

Read the docs →
Does a single request calculate both permutations and combinations?
Yes. Every request takes your total count of items and the number chosen, returning both the permutation P(n,r) and combination C(n,r) values in the same response.
Can I set the number of chosen items higher than the total items?
No. The parameter r must be less than or equal to n. Combinatorial calculations require choosing from an existing pool, so r cannot exceed the total number of items provided.
Are the mathematical formulas included on the Free plan?
No. The Free plan returns the calculated numerical results for permutations and combinations, but the step-by-step mathematical formulas are premium fields unlocked on paid plans like Starter.
Does the calculator accept decimal or negative numbers?
No. Both n and r must be integers. The calculation requires discrete whole numbers representing items in a set and items being chosen.
Which plan fits 50,000 combinatorial calculations a month?
The Starter plan covers this volume with room to spare. At 2 credits per call, 50,000 calculations use 100,000 of the 200,000 monthly credits on Starter, working out to about $0.30 per 1,000 calls. The Free plan gives you 100 calls each month for testing.

Ready to build with Permutation & Combination Calculator? Start with 200 free credits — one key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs