
Four small trays of different character-like abstract tiles without actual letters. Original AI-generated artwork produced for GreenCalc; not a measured diagram or empirical data display.
Exclude strings that miss required categories
Consider two disjoint character groups with sizes two and three. For length three, unrestricted repetition gives 5³ = 125 strings. If each string must contain at least one character from both groups, remove the 2³ strings drawn only from the first group and the 3³ drawn only from the second. The result is 125−8−27 = 90.
Why simple subtraction needs correction with more groups
With three or more required groups, a string can omit multiple groups and be subtracted more than once. Inclusion–exclusion alternately adds and subtracts the counts for every subset of omitted groups. For a fixed length L, omitting a subset leaves the sum of the remaining group sizes available in each position. Raise that remaining size to L, then apply the appropriate sign.
Handle a length range as disjoint possibilities
Strings of different lengths are different outcomes, so counts can be added across the allowed lengths. In the two-group example, length two contributes 5²−2²−3² = 12 valid strings. Allowing lengths two through three therefore gives 12+90 = 102. If a length is shorter than the number of required groups, no string at that length can satisfy every requirement.
Count only the rules actually represented
The Password Combination Calculator implements these disjoint-group requirements exactly with integer arithmetic. It does not model forbidden substrings, position-specific character rules or a ban on adjacent repeats. Such restrictions require another counting model. Read policy count versus entropy before treating the count as a strength score. The existing Combination Calculator counts unordered selections, whereas character positions are ordered and repeated symbols are permitted in this policy model.
Check the model behind your result
Use the Password Combination Calculator for the supported calculation and review its stated assumptions before interpreting the output. Find related tools in the Statistics category, or browse the GreenCalc homepage for other calculation topics.
By GreenCalc Editorial Team · Updated 2026-10-26
