The GRAVITY instrument has been commissioned on the VLTI during 2016 and is now available to the astronomical community. It is the first optical interferometer capable of observing sources as faint as magnitude 19 in K-band. This is possible thanks to the fringe tracker which compensates the differential piston based on measurements of a brighter off-axis astronomical reference source. The goal of this paper is to consign the main developments made in the context of the GRAVITY fringe tracker. This could serve as basis for future fringe tracking systems. The paper therefore covers all aspects of the fringe tracker, from hardware, to control software and on-sky observations. Special emphasis is placed on the interaction between the group delay controller and the phase delay controller. The group delay control loop is a simple but robust integrator. The phase delay controller is a state-space control loop based on an auto-regressive representation of the atmospheric and vibrational perturbations. A Kalman filter provides optimal determination of the state of the system. The fringe tracker shows good tracking performance on sources with coherent K magnitudes of 11 on the UTs and 9.5 on the ATs. It can track fringes with an SNR level of 1.5 per DIT, limited by photon and background noises. On the ATs, during good seeing conditions, the optical path delay residuals can be as low as 75 nm root mean square. On the UTs, the performance is limited to around 250 nm because of structural vibrations.