This study investigates the effectiveness of thin-film composite (TFC) membranes prepared through interfacial polymerization (IP) using various linear diamines (LD) in conjunction with piperazine (PIP) to mitigate magnesium ion permeation. Among the tested LDs, 1,4-butylenediamine (BDA) was selected for further analysis due to its superior performance in TFC membrane fabrication. A systematic examination was conducted on the effects of varying BDA to PIP ratios and their concentrations on the separation efficiency of the TFC membranes. Characterization techniques, including attenuated total reflectance Fourier-transform infrared (ATR-FTIR), X-ray photoelectron spectroscopy (XPS), scanning electron microscopy (SEM), energy-dispersive X-ray spectroscopy (EDS), and atomic force microscopy (AFM), were employed to elucidate the structural characteristics and surface morphology of the membranes. The results show that longer LD carbon chains in the aqueous phase lead to higher molecular weight cutoff (MWCO) and a looser structure of the composite membranes. Furthermore, increasing BDA concentration slightly raises membrane MWCO but significantly enhances salt rejection performance due to stronger charge effects. By simulating the brine composition diluted 10 times from the Yiliping Salt Lake in Qinghai Province, China. A typical feed of high-magnesium (CMg 2+ = 7500 mg/L) and high-magnesium-to-lithium ratio (Mg2+/Li+ = 28.42), the TFC membrane with an optimal BDA additive ratio achieved a remarkable SLi,Mg of 31.66 along with a Mg2+ rejection rate of 96.34%, coupled with favorable water permeability properties. These findings underscore significant application potential for this membrane technology. Finally, we discuss the mechanisms by which LD interact during the IP process to influence both structure and properties of TFC membranes.