San Ildefonso is a municipality located in the province of Segovia within the Castile and León autonomous community in central Spain. It is also known by the names San Ildefonso, La Granja, or La Granja de San Ildefonso.
The town is situated in the historical region of Castile and León and serves as a recognized administrative division of the province of Segovia.