Algar (before 1842 Santa María de Guadalupe del Algar) is a Spanish municipality in the province of Cádiz, Andalusia.
In 2008 it had 1,564 inhabitants. It covers an area of 27 km² and has a population density of 58.8 inhabitants/km². Its geographical coordinates are 36º 39′ N, 5º 39′ W. It is located at an altitude of 212 metres and 87 kilometres from the provincial capital, Cádiz. It forms part of the Route of the White Villages, next to the river Majaceite and very close to the Hurones reservoir (the main source of water in Cádiz).
Its history is quite different from that of the other villages that surround it, since, although human remains date back to the Neolithic period, the origin of the village dates back to 1773. It was created by the wealthy merchant Domingo López de Carvajal, after buying some meadows in 1757 and subsequently populating them with settlers.
Consequently, its urban layout is rationalist, with parallel streets and a central square. A famous personage of the 20th century was Father Leonardo Castillo. Nowadays Algar lives from agriculture, livestock, leather work, wood and rural tourism.