ABSTRA C T PINOCCHIO (PINpointing Orbit-Crossing Collapsed HIerarchical Objects) is a new algorithm proposed recently by Monaco et al. (Paper I) for identifying dark matter haloes in a given numerical realization of the linear density field in a hierarchical universe. Mass elements are assumed to have collapsed after undergoing orbit crossing, as computed using perturbation theory. It is shown that Lagrangian perturbation theory, and in particular its ellipsoidal truncation, is able to predict accurately the collapse, in the orbit-crossing sense, of generic mass elements. Collapsed points are grouped into haloes using an algorithm that mimics the hierarchical growth of structure through accretion and mergers. Some points that have undergone orbit crossing are assigned to the network of filaments and sheets that connects the haloes; it is demonstrated that this network resembles closely that found in N-body simulations. The code generates a catalogue of dark matter haloes with known mass, position, velocity, merging history and angular momentum. It is shown that the predictions of the code are very accurate when compared with the results of large N-body simulations that cover a range of cosmological models, box sizes and numerical resolutions. The mass function is recovered with an accuracy of better than 10 per cent in number density for haloes with at least 30 ‐ 50 particles. A similar accuracy is reached in the estimate of the correlation length r0. The good agreement is still valid on the object-by-object level, with 70 ‐ 100 per cent of the objects with more than 50 particles in the simulations also identified by our algorithm. For these objects the masses are recovered with an error of 20 ‐ 40 per cent, and positions and velocities with a root mean square error of ,1 ‐2 MpcO0:5 ‐ 2 grid lengths) and ,100 km s 21 , respectively. The recovery of the angular momentum of haloes is considerably noisier, and accuracy at the statistical level is achieved only by introducing free parameters. The algorithm requires negligible computer time as compared with performing a numerical N-body simulation.