Maths & numbers

Catalan number calculator

Count balanced parentheses strings with n pairs, among other Catalan structures.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

A balanced sequence never closes more parentheses than it has opened in any prefix.

THE FORMULACₙ = binom(2n,n)/(n+1)

A worked example

Five pairs can form 42 balanced strings.

Good to know

The index starts at zero.

Read the result

Count balanced parentheses strings with n pairs, among other Catalan structures.

The primary result is labeled “Catalan number”. Keep the input definitions in view when comparing this result with another method.

Try a related calculation

The index starts at zero.

For a related exercise, try the greatest common divisor.

A few questions, answered

How can I check the default inputs by hand?

Five pairs can form 42 balanced strings.

Which rule does this calculator apply?

Cₙ = binom(2n,n)/(n+1)

Find your calculator

Start typing to explore the library.