The town distributes its territory into six districts: Ciutat Cooperativa-Molí Nou, Marianao-Can Paulet, Barri Centre, Vinyets-Molí Vell, Camps Blancs-Canons-Orioles and Casablanca.
It limits to the north with the towns of Santa Coloma de Cervelló, Sant Joan Despí and the village of Sant Climent de Llobregat, to the east with the town of Cornellà de Llobregat, to the west with Viladecans and to the south with El Prat de Llobregat, having a narrow land extension to the south that enters into the Mediterranean Sea.
The finding of archeological remains corresponding to Iberian colonies (VI-I bC) and the Romans (I-V aC) - a noteworthy Roman bath is located near the river - suggests that the origins of Sant Boi can be found in pre-Roman times.
Like most of the surrounding lands, from the 7th to the 12th century the town was controlled by the Moors, until their expulsion from Iberia during the Reconquista. The Moors called it "Alcala", which means castle, due to the existence of a hillock from where the river and the valley were dominated. Its present name derives from the name of Saint Baudilus, known as Boi or Baldiri in Catalonia.
During the Middle Ages the village was progressively populated, growing from the surroundings of the castle to adjacent zones. A baroque style church is built during the 16th century. The growth keeps on during the following centuries, giving rise to numerous "Masies" (typical Catalan agricultural housing) near the river and the most fertile lands. At the end of the 19th century Sant Boi was a village of nearly 5000 inhabitants, with an economy mainly based in agriculture.
At the beginnings of the 20th century the first industries flourished in Sant Boi, ranging from brick manufacture to metalwork. With the end of the Spanish Civil War in 1939 there is a massive inflow of immigration coming from diverse points of the Spanish geography. These flows of population consisted mainly in people from villages and small towns searching a job and career opportunities in the town of Barcelona, stimulated by the increasing demand of workmanship in the regrowth of the Catalan industry during the postwar period. The population rises from 10.000 people in 1940 to 65.000 in 1975. This period is characterized by the construction of complete quarters (Casablanca, Camps Blancs, Cooperativa) dedicated to housing for the immigration.
Nowadays Sant Boi is a town with more than 80,000 inhabitants, with well-established industrial and services sectors, and a healthy cultural and recreational offer.