The driving distance from Santa Coloma de Gramenet and Madrid is about 627 kilometers.