Although the use and promotion of renewable energies have increased in recent years, it is evident that the use of fossil fuels such as oil and gas continues to be of great importance. Likewise, pipelines are widely recognized as the most reliable and profitable means of transportation for liquid and gaseous hydrocarbons. Nevertheless, due to the nature of hydrocarbons, oil and gas pipelines are continually exposed to deterioration by corrosion and mechanical damage. In this context, this research focuses on the improvement of the surface properties of API 5L grade B pipeline steel by applying a surface hardening process. Samples of an API 5L grade B pipeline steel were exposed to boriding to form a layer of high hardness (from 2.60 GPa for the non-treated material to 14.12 GPa for the samples exposed to 1000 °C for 6 h). The treatment time was set at 2, 4, and 6 h, at temperatures of 850, 900, 950, and 1000 °C. Due to the saw-tooth morphology of the layers and the random nature of the process, it was possible to fit their thicknesses to a probability density function in all the experimental conditions. The crystalline structure of the layers was analyzed by X-ray diffraction and the morphology was observed using SEM and optical microscopy. The layer’s thickness ranged between 26.6 µm to 213.9 µm showing a close relationship with the experimental parameters of time and temperature. Finally, it is studied the changes undergone in the pipeline steel after the thermochemical process, observing an increase in the grain size as a function of the temperature.