Optimal sample sizes under a budget constraint for estimating a proportion in a two-stage sampling process have been derived using individual testing. However, when group testing is used, these optimal sample sizes are not appropriate. In this study, optimal sample sizes at the cluster and individual levels are derived for group testing. First, optimal allocations of clusters and individuals are obtained under the assumption of equal cluster sizes. Second, we obtain the relative efficiency (RE) of unequal versus equal cluster sizes when estimating the average population proportion, $$\tilde {>\pi } $$ . By multiplying the sample of clusters obtained assuming equal cluster size by the inverse of the RE, we adjust the sample size required in the context of unequal cluster sizes. We also show the adjustments that need to be made to allocate clusters and individuals correctly in order to estimate the required budget and achieve a certain power or precision.