San Ildefonso, or La Granja, or La Granja de San Ildefonso, is a town and municipality in the Province of Segovia, in the Castile and León Autonomous region of central Spain.
It is located in the foothills of the Sierra de Guadarrama mountains, 11 kilometres (6.8mi) from Segovia, and 80 kilometres (50mi) north of Madrid.