Catalan Number Calculator

Find any Catalan number Cₙ.

Result

16,796

How it is calculated

The tool uses the product form of the recurrence instead of large factorials: start with C = 1 and, for k = 0 to n-1, multiply C = C × 2(2k+1) / (k+2). This gives the same value as Cₙ = (2n)! / ((n+1)!·n!), where n is a whole number (no unit). A decimal entry such as 5.7 is cut down to 5. Only n from 0 to 30 is accepted; a negative n or anything above 30 returns no result. The answer is rounded to a whole number and shown with thousands separators.

Worked example

For n = 10: (2n)! / ((n+1)!·n!) = 20! / (11!·10!). Running the product from k = 0 to 9 gives the sequence 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, and finally 16796 at n = 10. The result is 16,796, which is the number of ways to match 10 pairs of parentheses correctly.

Try this example →

Common mistakes

  • Counting from the wrong index: C₀ = 1 and C₁ = 1, so n = 3 gives 5, not the value for 3 pairs minus one.
  • Entering the number of polygon sides instead of n: a polygon with m sides is triangulated in C(m-2) ways, so a hexagon needs n = 4 (answer 14).
  • Entering a value above 30 and expecting a huge number; the tool returns nothing there.
  • Typing a decimal like 5.7 and expecting rounding up; it is truncated to 5, giving 42.

About this calculator

This calculator finds the nth Catalan number: Cn = (2n)! / ((n+1)! · n!), a sequence (1, 1, 2, 5, 14, 42, 132, …) that counts a surprising number of unrelated-looking combinatorial structures of size n, including the number of ways to correctly match n pairs of balanced parentheses, the number of distinct binary search trees with n nodes, and the number of ways to triangulate a convex polygon with n+2 sides.

Computer science students and researchers use it to count valid expression trees, parsing possibilities, and recursive data structures, while math enthusiasts use it as a classic example of how one recurrence relation reappears across many different combinatorics problems.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    A quick sanity check is the growth rate: each Catalan number is the previous one times 2(2n plus 1) divided by (n plus 2), a factor that climbs toward 4. Going from n = 10 to 11 multiplies 16,796 by 3.5. The same sequence counts triangulations of a convex polygon with n plus 2 sides, which makes a handy test case. Which structure are you counting: bracket pairs, trees, paths or something else?

Popular calculators

All Calculators