Skip to content
100% local

Bell numbers

Calculate the Bell number for a set and list its partitions.

Input
Output

Bell numbers

Paste a list of elements, one per line, and this tool counts every way to split that set into non-empty, unordered groups — the Bell number — and prints the groupings themselves so you can see exactly what they look like. It is useful for teaching combinatorics, checking a homework answer, or generating every valid grouping of a small team, a set of test cases, or a short list of categories.

Set "Number of groups" to 0 to count every partition regardless of size, or to a fixed number to restrict the count to partitions with exactly that many groups — the Stirling number of the second kind. "Order of groups matters" switches to ordered partitions, where {a} then {b, c} counts separately from {b, c} then {a} — the Fubini, or ordered Bell, number. "Allow duplicate elements" decides whether repeated lines collapse into one element or stay separate. "Separator inside a group" controls how elements within one group are joined.

Because the number of partitions explodes far faster than input size — a set of just 15 elements already has over 1.3 billion — the tool only lists what fits: "Max partitions to list" caps how many groupings print, while the live count next to the output stays exact, computed directly rather than by generating everything first. Turn on the combinatorial-explosion warning for a note whenever more partitions exist than were listed. Sets larger than 130 elements are rejected outright, since the count would already run to hundreds of digits.

Everything runs locally in your browser — nothing you paste is uploaded anywhere. Copy the result, download it as a .txt file, or send it straight into another tool's input to keep working with it.

FAQ

What is a Bell number?
The Bell number of a set counts the number of distinct ways to partition it into non-empty, unordered groups that together cover every element exactly once.
What does "Order of groups matters" change?
With it off, the tool counts and lists ordinary set partitions. With it on, it counts ordered partitions instead (the Fubini number) — the same grouping in a different sequence counts as a separate result.
Why is the set size limited?
Bell numbers grow faster than exponentially: a 130-element set already has a count with hundreds of digits, so larger sets are rejected to keep the result exact and the tool responsive.
Why doesn’t the output list every partition?
The count can run into the billions long before the set gets large. "Max partitions to list" caps how many are actually printed, while the reported count stays exact regardless.
Is my list uploaded anywhere?
No. Every calculation runs entirely in your browser — your list is never sent to a server.