  This paper presents the High Frequency Instrument (HFI) data processing
procedures for the Planck 2018 release. Major improvements in mapmaking have
been achieved since the previous 2015 release. They enabled the first
significant measurement of the reionization optical depth parameter using HFI
data. This paper presents an extensive analysis of systematic effects,
including the use of simulations to facilitate their removal and characterize
the residuals. The polarized data, which presented a number of known problems
in the 2015 Planck release, are very significantly improved. Calibration, based
on the CMB dipole, is now extremely accurate and in the frequency range 100 to
353 GHz reduces intensity-to-polarization leakage caused by calibration
mismatch. The Solar dipole direction has been determined in the three lowest
HFI frequency channels to within one arc minute, and its amplitude has an
absolute uncertainty smaller than $0.35\mu$K, an accuracy of order $10^{-4}$.
This is a major legacy from the HFI for future CMB experiments. The removal of
bandpass leakage has been improved by extracting the bandpass-mismatch
coefficients for each detector as part of the mapmaking process; these values
in turn improve the intensity maps. This is a major change in the philosophy of
"frequency maps", which are now computed from single detector data, all
adjusted to the same average bandpass response for the main foregrounds.
Simulations reproduce very well the relative gain calibration of detectors, as
well as drifts within a frequency induced by the residuals of the main
systematic effect. Using these simulations, we measure and correct the small
frequency calibration bias induced by this systematic effect at the $10^{-4}$
level. There is no detectable sign of a residual calibration bias between the
first and second acoustic peaks in the CMB channels, at the $10^{-3}$ level.
