Background/aimDuring the coronavirus disease (COVID-19) pandemic, Germany and various other countries experienced a shortage of polymerase chain reaction (PCR) laboratory tests due to the highly transmissible SARS-CoV-2 Omicron variant that drove an unprecedented surge of infections. This study developed a mathematical model that optimizes diagnostic capacity with lab-based PCR testing.MethodsA mathematical model was constructed to determine the value of PCR testing in relation to the pre-test probability of COVID-19. Furthermore, the model derives the lower and upper bounds for the threshold pre-test probability of the designated priority group. The model was applied in a German setting using the PCR test-positivity rate at the beginning of February 2022.ResultsThe value function of PCR testing is bell-shaped with respect to the pre-test probability, reaching a maximum at a pre-test probability of 0.5. Based on a PCR test-positivity rate of 0.3 and assuming that at least two thirds of the tested population have a pre-test probability below, lower and higher pre-test probability thresholds are ≥ 0.1 and 0.7, respectively. Therefore, individuals who have a 25% likelihood of testing positive because they exhibit symptoms should be a higher priority for PCR testing. Furthermore, a positive rapid antigen test in asymptomatic individuals with no known exposure to COVID-19 should be confirmed using PCR. Yet, symptomatic individuals with a positive RAT should be excluded from PCR testing.ConclusionA mathematical model that allows for the optimal allocation of scarce PCR tests during the COVID-19 pandemic was developed.