In recent years, trimeric surfactants have created excitement in the surfactant field because of their properties, which have been found to be better than monomeric or dimeric homologues. Only a limited number of trimeric surfactants have been synthesized and studied so far, probably owing to the difficulty in synthesis. In this article, we synthesized some novel star-shaped trimeric cationic surfactants based on the alkylation of the 3 hydroxyl groups of the phloroglucinol nuclei as a core (i.e., spacer) with 3 dodecyl or 3 octyl groups (as tails) for the surfactant. The chemical structures were confirmed by nuclear magnetic resonance, Fourier transform infrared, mass spectrometry, and elemental analysis; also the critical micelle concentration was determined by electrical conductivity measurements. These surfactants were used in the synthesis of mesoporous silica nanoparticles by the sol-gel method. The silica particles shape and size were determined using field emission scanning electron microscopy and high-resolution transmission electron microscopy images. Furthermore, the corrosion inhibitor capability of these surfactants was investigated by monitoring the corrosion rate of iron sheets in 0.5 M hydrochloric acid in the presence and in the absence of different surfactants at 45 degrees C based on the weight loss method. We have used cetyltrimethylammonium bromide (CTAB) as a positive control, the obtained results showed a high inhibition efficiency at very low concentrations, and the prepared trimeric surfactants exhibited a higher anticorrosion efficiency than the CTAB surfactants.