Abstract Segregation to grain boundaries affects their cohesion, corrosion, and embrittlement and plays a critical role in heterogeneous nucleation. In order to quantitatively study segregation and low-dimensional phase separation at grain boundaries, here, we apply a density-based phase-field model. The current model describes the grain-boundary thermodynamic properties based on available bulk thermodynamic data, while the grain-boundary-density profile is obtained using atomistic simulations.