TiN, which is ubiquitous in Ti-bearing steel, has a critical influence on both the mechanical properties and the welding process of steel, and therefore researche on the precipitation behavior of TiN in molten steel bath is of great significance. In this paper, Ti-bearing peritectic steel was taken as the study object and FactSage was adopted to explore how the precipitation behavior of typical inclusions in steel was affected by the steel composition. Furthermore, microsegregation models were used to analyze the precipitation process of TiN at solidification front, and the calculation results were finally verified by scanning electron microscope (SEM). Research showed that a multitude of dispersed particles of high melting oxide MgAl2O4 or MgO always existed in molten steel after magnesium treatment. In consideration of the segregation and enrichment of solute elements at the solidification front, the Ohnaka microsegregation model was employed to compute the precipitation during solidification. In the event of the solid fraction reaching 0.95 or more, the concentration product of [Ti][N] at the solidification front exceeded the equilibrium concentration product, then TiN began to precipitate. MgO or MgAl2O4 cores were generally found in TiN particles of peritectic steel after the magnesium treatment, which was consistent with the thermodynamic calculation results. Moreover, the average size of TiN particles was reduced by approximately 49%. This demonstrated that Mg-rich high melting inclusions were formed after the magnesium treatment, by which the heterogeneous nucleation of TiN was promoted it; therefore, favorable nucleation sites were provided for further refining the high-temperature ferrite phase.