In this study, we introduce a template matching algorithm using the grand average as a dynamic template to extract P3 latencies. This new algorithm outperforms peak latency and fractional area latency algorithms in both empirical as well as simulated data. Template matching algorithms showed the highest correlation with latencies extracted by expert researchers and the most accurate recovery of simulated latency shifts. Our results highlight the robustness of template matching algorithms across various tasks, preprocessing steps, and algorithm hyperparameters. Additionally, template matching provides a fit statistic that researchers can use to automatically discard ERPs with poor matches or flag certain ERPs for manual review. This template matching algorithm is objective, efficient, reliable, and more valid than previous methods such as peak latency or fractional area latency. Finally, the straightforward application of our template matching algorithm allows it to be easily integrated into multiverse studies or automated pipelines.