Modern semiconductor detectors allow for charged particle tracking with ever increasing position resolution. Due to the reduction of the spatial hit uncertainties, multiple Coulomb scattering in the detector layers becomes the dominant source for tracking uncertainties. In this case long distance effects can be ignored for the momentum measurement, and the track fit can consequently be formulated as a sum of independent fits to hit triplets. In this paper we present an analytical solution for a three-dimensional triplet(s) fit in a homogeneous magnetic field based on a multiple scattering model. Track fitting of hit triplets is performed using a linearization ansatz. The momentum resolution is discussed for a typical spectrometer setup. Furthermore the track fit is compared with other track fits for two different pixel detector geometries, namely the Mu3e experiment at PSI and a typical high-energy collider experiment. For a large momentum range the triplets fit provides a significantly better performance than a single helix fit. The triplets fit is fast and can easily be parallelized, which makes it ideal for the implementation on parallel computing architectures.