This paper describes the 2018 Planck CMB likelihoods, following a hybrid approach similar to the 2015 one, with different approximations at low and high multipoles, and implementing several methodological and analysis refinements. With more realistic simulations, and better correction and modelling of systematics, we can now make full use of the High Frequency Instrument polarization data. The low-multipole 100x143 GHz EE cross-spectrum constrains the reionization optical-depth parameter $tau$ to better than 15% (in combination with with the other low- and high-$ell$ likelihoods). We also update the 2015 baseline low-$ell$ joint TEB likelihood based on the Low Frequency Instrument data, which provides a weaker $tau$ constraint. At high multipoles, a better model of the temperature-to-polarization leakage and corrections for the effective calibrations of the polarization channels (polarization efficiency or PE) allow us to fully use the polarization spectra, improving the constraints on the $Lambda$CDM parameters by 20 to 30% compared to TT-only constraints. Tests on the modelling of the polarization demonstrate good consistency, with some residual modelling uncertainties, the accuracy of the PE modelling being the main limitation. Using our various tests, simulations, and comparison between different high-$ell$ implementations, we estimate the consistency of the results to be better than the 0.5$sigma$ level. Minor curiosities already present before (differences between $ell$<800 and $ell$>800 parameters or the preference for more smoothing of the $C_ell$ peaks) are shown to be driven by the TT power spectrum and are not significantly modified by the inclusion of polarization. Overall, the legacy Planck CMB likelihoods provide a robust tool for constraining the cosmological model and represent a reference for future CMB observations. (Abridged)