Calculators
Catalan Number Calculator
Calculate exact Catalan numbers for indices 0 to 1000 privately in your browser, with digit counts and the counting formula.
Count balanced structures with Catalan numbers.
The nth Catalan number is C(n) = (2n)! ÷ [n! × (n + 1)!]. It counts balanced parenthesis strings containing n pairs, full binary tree shapes with n internal nodes, and triangulations of a convex polygon with n + 2 vertices for n ≥ 1. The sequence begins C(0) = 1, C(1) = 1, C(2) = 2, C(3) = 5, C(4) = 14 and C(5) = 42. For example, three pairs have five balanced arrangements: ((())), (()()), (())(), ()(()) and ()()(). Enter an index from 0 to 1000 using one to four digits; leading zeros and surrounding whitespace are accepted. Signs, decimals, separators and scientific notation are rejected. The recurrence C(k + 1) = 2 × (2k + 1) × C(k) ÷ (k + 2), starting at C(0) = 1, uses exact BigInt arithmetic without factorial intermediates. Results include every digit and a digit count. All calculations stay in your browser.
Frequently Asked Questions
Everything you need to know about this tool, how it works, and privacy.
What does a Catalan number count?
C(n) counts balanced parenthesis strings with n pairs and full binary tree shapes with n internal nodes. For example, C(3) = 5.
Why is C(0) equal to 1?
There is one empty parenthesis string. This base case also makes the Catalan recurrence work from zero.
How is the result calculated?
Starting with C(0) = 1, the calculator applies C(k + 1) = 2 × (2k + 1) × C(k) ÷ (k + 2). BigInt arithmetic preserves every digit.
Which inputs are supported?
Enter an index from 0 to 1000 with one to four digits. Leading zeros and surrounding whitespace are accepted. Signs, decimals, separators and scientific notation are rejected. Calculations run locally in your browser.