The severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) pandemic can be effectively controlled by rapid and accurate identification of SARS-CoV-2-infected cases through large-scale screening. Hypercube pooling polymerase chain reaction (PCR) is frequently used as a pooling technique because of its high speed and efficiency. We attempted to implement the hypercube pooling strategy and found it had a large quantization effect. This raised two questions: is hypercube pooling with edge = 3 actually the optimal strategy? If not, what is the best edge and dimension? We used a C++ program to calculate the expected number of PCR tests per patient for different values of prevalence, edge, and dimension. The results showed that every edge had a best performance range. Then, using C++ again, we created a program to calculate the optimal edge and dimension required for pooling samples when entering prevalence into our program. Our program will be provided as freeware in the hope that it can help governments fight the SARS-CoV-2 pandemic.