We present a galaxy group-finding algorithm, the photo-z probability peaks (P3) algorithm, optimized for locating small galaxy groups using photometric redshift data by searching for peaks in the signal-to-noise ratio (S/N) of the local overdensity of galaxies in a 3D grid. This method is an improvement over similar 2D matched-filter methods in reducing background contamination through the use of redshift information, allowing it to accurately detect groups at lower richness. We present the results of tests of our algorithm on galaxy catalogues from the Millennium simulation. Using a minimum S/N of 3 for detected groups, a group aperture size of 0.25 h−1 Mpc, and assuming photometric redshift accuracy of σz= 0.05, it attains a purity of 84 per cent and detects ∼295 groups deg−2 with an average group richness of 8.6 members. Assuming photometric redshift accuracy of σz= 0.02, it attains a purity of 97 per cent and detects ∼143 groups deg−2 with an average group richness of 12.5 members. We also test our algorithm on data available for the COSMOS field and the presently available fields from the Canada–France–Hawaii Telescope Legacy Survey (CFHTLS)-Wide survey, presenting preliminary results of this analysis.