᠎᠎᠎          
51K

Powerset generator

World's simplest set tool

With this online application, you can quickly find the power set P(S) of the given input set S. As the power set for an n element set is made out of 2n subsets, the input set size is limited to 16 elements, which will generate 65,536 subsets. In the options, you can control the generation order of subsets and also the order of elements within subsets. You can also customize the looks of the output power set and individual subsets. Created by team Browserling.
We created a cloud browser! Browserling
Check out our project Browserling – anonymous cloud browser.
Input Set Options
Enter the symbol that separates the input set elements.
Open set symbol.
Close set symbol.
Output Power Set Options
Enter the symbol that separates the elements of individual subsets.
Enter the symbol that separates the generated subsets.
Open set symbol.
Close set symbol.
Subset and Element Order
Select the order of subsets.
Select the order of elements.
Powerset generator tool What is a powerset generator?
This browser-based program generates all subsets of the given set. This is called the powerset and it includes the empty set and also the set itself. Given the set A, the usual notation for the powerset is P(A) or if you love fancy things, also 𝒫(A) and ℙ(A). If the cardinality (number of elements) of the input set A is n, then the powerset is made out of 2n elements. The number 2n grows exponentially fast and for just 10 element set it already exceeds 1000. By default, the powerset generator prints subsets from the one with least elements to the one with most elements – first, it's the empty set, then the singleton subsets, then the two-element subsets, and so on. You can also change the order of this output in the options and display subsets from the one with most elements to the one with least elements or print them in random order. You can also change the order of elements in the subsets – they can go from left to right, from right to left, or in random order. As different programming languages use different syntax for sets, you can also customize the format of the output subsets – you can change the open-set symbol "{" and the close-set symbol "}" and change the set element delimiter "," to something else. Setabulous!
Powerset generator examples Click to use
Powerset of 4 Elements
In this example, we generate a powerset from a four-element set. The elements of this set are digits from 1 to 4 and the set is entered using standard mathematical notation, where commas separate the elements and the set is enclosed in curly brackets. The powerset of a set of four elements creates 24 = 16 subsets. We generate them in order of their cardinality (from the smallest subset to the largest subset) and also use the standard set format in the output.
{1, 2, 3, 4}
{} {1} {2} {3} {4} {1, 2} {1, 3} {1, 4} {2, 3} {2, 4} {3, 4} {1, 2, 3} {1, 2, 4} {1, 3, 4} {2, 3, 4} {1, 2, 3, 4}
Required options
These options will be used automatically if you select this example.
Enter the symbol that separates the input set elements.
Open set symbol.
Close set symbol.
Enter the symbol that separates the elements of individual subsets.
Enter the symbol that separates the generated subsets.
Open set symbol.
Close set symbol.
Select the order of subsets.
Select the order of elements.
Power Set of the Alphabet
This example loads a set of first five English letters as input elements and returns the power set of 32 sets in the output. It changes the subset order in the output and first prints the 5-element set with all the letters (same as input set), then all possible 4-element sets with all possible four-letter combinations, then all possible 3-element sets with three letters, then 2-element sets with two letters, then 1-element sets, and then the only 0-element set (null set). It also changes the letter order and takes the elements from the input set from right to left when creating subsets. It uses angle brackets as set-open and set-close characters, removes separators between set elements, and prints all subsets on one line, separated by commas.
{a, b, c, d, e}
<edcba>, <dcba>, <ecba>, <edba>, <edca>, <edcb>, <cba>, <dba>, <dca>, <dcb>, <eba>, <eca>, <ecb>, <eda>, <edb>, <edc>, <ba>, <ca>, <cb>, <da>, <db>, <dc>, <ea>, <eb>, <ec>, <ed>, <a>, <b>, <c>, <d>, <e>, <>
Required options
These options will be used automatically if you select this example.
Enter the symbol that separates the input set elements.
Open set symbol.
Close set symbol.
Enter the symbol that separates the elements of individual subsets.
Enter the symbol that separates the generated subsets.
Open set symbol.
Close set symbol.
Select the order of subsets.
Select the order of elements.
Unicode Powerset
In this example, we enter a very unusual set in the input and get an even more unusual powerset in the output. Each element of the input set is a Unicode fruit emoji. As the input emojis are separated by spaces and there are no open/close set symbols around the set elements, in the options we use the space character as the input element separator and leave the open/close set character fields empty. Additionally, we use the bold curly brackets to enclose the fruit subsets and put the "❌" symbol between subset elements.
🍍 🍎 🥝 🍇
❴❵ ❴🍍❵ ❴🍎❵ ❴🥝❵ ❴🍇❵ ❴🍍❌🍎❵ ❴🍍❌🥝❵ ❴🍍❌🍇❵ ❴🍎❌🥝❵ ❴🍎❌🍇❵ ❴🥝❌🍇❵ ❴🍍❌🍎❌🥝❵ ❴🍍❌🍎❌🍇❵ ❴🍍❌🥝❌🍇❵ ❴🍎❌🥝❌🍇❵ ❴🍍❌🍎❌🥝❌🍇❵
Required options
These options will be used automatically if you select this example.
Enter the symbol that separates the input set elements.
Open set symbol.
Close set symbol.
Enter the symbol that separates the elements of individual subsets.
Enter the symbol that separates the generated subsets.
Open set symbol.
Close set symbol.
Select the order of subsets.
Select the order of elements.
Pro tips Master online set tools
You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!
https://onlinesettools.com/generate-powerset?input=%7B1%2C%202%2C%203%2C%204%7D&input-element-separator=%2C%20&input-open-set=%7B&input-close-set=%7D&output-element-separator=%2C%20&output-subset-separator=%5Cn&output-open-set=%7B&output-close-set=%7D&subset-order=least-to-most&element-order=left-to-right
All set tools
Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!
Quickly find the powerset P(S) of the given set S.
Quickly reverse the order of elements in an ordered set.
Quickly find the number of elements in a set.
Quickly apply the set union operation on two or more sets.
Quickly apply the set intersection operation on two or more sets.
Quickly apply the set difference operation on two or more sets.
Coming soon These set tools are on the way
Draw a Venn Diagram
Illustrate two or more sets as a Venn diagram.
Find Set Symmetric Difference
Apply the set difference operation on sets A and B.
Find Set Cartesian Product
Apply the set cartesian product operation on sets A and B.
Find All Subsets of a Set
Quickly find all sets that are subsets of set A.
Find All Set Permutations
Generate all permutations of set elements.
Enumerate a Set
Add numbering to all set elements.
Filter a Set
Print set elements that match a filter.
Find Set Elements
Find elements in a set that match certain criteria.
Apply a Function on a Set
Run a function on all elements in a set.
Convert a Multiset to a Set
Convert a set with repeated elements to a standard set.
Convert a Set to a List
Create a list from the given set.
Convert a List to a Set
Create a set from the given list.
Convert a Set to an Array
Create an array from the given set.
Convert an Array to a Set
Create a set from the given array.
Duplicate Set Elements
Repeat set elements multiple times.
Print Duplicate Elements
Find all duplicate elements in a set.
Remove Duplicate Elements
Delete all duplicate elements from a set (leave unique).
Print Unique Elements
Find all unique elements in a set.
Remove Unique Elements
Delete all unique elements from a set (leave duplicates).
Remove Empty Set Elements
Delete empty elements (zero-length elements) from a set.
Find Set Depth
Calculate how many levels of subsets a set has.
Flatten a Set
Decrease subset nesting.
Truncate a Set
Remove elements from a set and make it smaller.
Truncate Set Elements
Shorten all set elements to the given length.
Expand a Set
Add elements to a set and make it bigger.
Split a Set
Split a set into a certain number of subsets.
Join Sets
Merge multiple sets together to form one large set.
Slice a Set
Extract an index-based subset from a set.
Partition a Set
Find disjoint subsets of the given set whose union is the same set.
Randomize a Set
Randomly change the order of elements in a set.
Select a Random Set Element
Pick a random element from the given set.
Select a Random Subset
Pick a random subset of the given set.
Generate an Empty Set
Create a set with no elements.
Generate a Digit Set
Create a set that contains digits.
Generate a Number Set
Create a set that contains numbers.
Generate an Integer Set
Create a set that contains integers.
Generate a Decimal Set
Create a set that contains decimal fractions.
Generate a Letter Set
Create a set that contains letters.
Generate a Character Set
Create a set that contains characters.
Generate a Word Set
Create a set that contains words.
Generate a String Set
Create a set that contains strings.
Generate a Text Set
Create a set that contains text.
Generate a Sentence Set
Create a set that contains sentences.
Generate a Random Set
Create a set that contains random elements.
Generate a Custom Set
Create a custom set with custom elements and custom size.
Generate an Infinite Set
Create a set with infinitely many elements.
Generate a Finite Set
Create a set with a finite number of elements.
Change Set Notation
Change the open-set, close-set, and element separator symbols.
Change Set Size
Add or remove set elements to make it a certain size/length.
Destroy a Set
Launch a Zalgo attack on a set and destroy it.
Compare Sets
Find all differences between two or more sets.
Symmetrize a Set
Convert a regular set to a symmetric multi-set.
Color a Set
Add colors to set elements.
Visualize a Set
Create an abstract visualization of a set.
Convert a Set to an Image
Create a downloadable picture from a set.
Print Set Analytics
Analyze a set and print its statistics.