This paper presents an in-pixel histogramming time-to-digital converter (hTDC) based on octonary search and 4-tap phase detection, aiming to improve frame rate and reduce distance error. The proposed hTDC is a 12-bit two-step converter consisting of a 6-bit coarse quantization and a 6-bit fine quantization, which achieves a time resolution of 120 ps without a GHz reference frequency and supports multiphoton counting up to 2 GHz. The proposed hTDC is designed in 0.11 μm CMOS process with an area consumption of 6900 μm 2. Timestamp sequences from a behavioral-level model are imported to the hTDC circuit for simulation verification. The post-simulation results show that the proposed hTDC achieves about 0.8% depth precision in 9-m range for short-range system design specifications and about 0.2% depth precision in 48-m range for long-range system design specifications. Under 30 klux background light conditions, the proposed hTDC can be used for SPAD-based flash LiDAR sensor to achieve a frame rate to 40 fps with 200-ps resolution in 9-m range.