ABSTRACT We present a novel approach for measuring the two-point correlation function of galaxies in narrow pencil beam surveys with varying depths. Our methodology is utilized to expand high-redshift galaxy clustering investigations up to z ∼ 8 by analysing a comprehensive sample consisting of Ng = 160 Lyman break galaxy candidates obtained through optical and near-infrared photometric data within the CANDELS GOODS data sets from the Hubble Space Telescope Legacy Fields. For bright sources with MUV < −19.8, we determine a galaxy bias of b = 9.33 ± 4.90 at $\overline{z} = 7.7$ and a correlation length of r0 = 10.74 ± 7.06 $h^{-1}\, \mathrm{Mpc}$. We obtain similar results for the XDF, with a galaxy bias measurement of b = 8.26 ± 3.41 at the same redshift for a slightly fainter sample with a median luminosity of MUV = −18.4. By comparing with dark-matter halo bias and employing abundance matching, we deduce a characteristic halo mass of Mh ∼ 1011.5 M⊙ and a duty cycle close to unity. To validate our approach for variable-depth data sets, we replicate the analysis in a region with near-uniform depth using a standard two-point correlation function estimator, yielding consistent outcomes. Our study not only provides a valuable tool for future utilization in JWST data sets but also suggests that the clustering of early galaxies continues to increase with redshift beyond z ≳ 8, potentially contributing to the existence of protocluster structures observed in early JWST imaging and spectroscopic surveys at z ≳ 8.